🗒️

감귤마켓 API 명세

💡
제가 만든 웹 페이지에서 로그인화면으로 넘어가지 않습니다! 현상 처리법 개발자도구 → Application → 로컬스토리지에 있는 토큰삭제
💡
3. 프로필 중 팔로우 관련 명세가 수정되었습니다. isfollow 값이 추가되어 팔로우한 유저인지 확인이 가능합니다. 2.5 계정 검증 명세가 추가되었습니다. 회원가입 시 이메일 검증 처럼 사용하시면 됩니다. 9. 토큰 검증 명세가 추가되었습니다. DB 초기화로 인해 존재하지 않는 유저에 대한 토큰인지를 판별합니다. isValid 값이 true, false로 반환됩니다.
💡
1. 이미지 업로드 명세가 수정되었습니다, 10. 이미지 업로드 가이드라인(특강코드)이 추가 되었습니다.
💡
프론트엔드 스쿨 기수가 진행되는 동안은 유지가 되나 그 외 기간은 중간에 서버를 닫을 수도 있습니다.
💡
이미 가입된 이메일이 있는지 확인할 수 있도록 추가하였습니다. 필요하신 분은 2.4 이메일 검증을 확인하시길 바랍니다.
💡
~url?limit=Number&skip=Number식의 쿼리를 날릴 수 있습니다. limit = {몇개 불러올지}&skip={몇개 건너뛸지} ex) 게시글 10개를 넘어가고 다음 5개의 게시글을 가져온다, 11번째 게시글부터 5개의 게시글 불러오기 /post/feed/?limit=5&skip=10 이 기능을 활용해서 페이지 처리를 할 수 있습니다!
 

0. 요청 url

url : https://mandarin.api.weniv.co.kr
감귤마켓 URL : http://146.56.183.55:3000/

* 요청 예시

-login

const url = "http://146.56.183.55:5050/" try{ const res = await fetch(url+"/user/login/", { method: "POST", headers: { "Content-Type": "application/json", }, body : JSON.stringify({ "user":{ "email": emailAddr.value, "password": pw.value } }) }) const resJson = await res.json() console.log(resJson) }catch(err){ }

-image

const url = "http://146.56.183.55:5050/" try { const response = await fetch(url+"/image/uploadfiles", { method: "POST", body : formData }); const data = await response.json(); for(let i of data) { name.push(i["filename"]) } if(name.length > 1) { return name.join(",") } else { return name[0]; } } catch (err) { console.error(err) }

1. 이미지

프로필 등록, 프로필 수정, 상품 등록 페이지 등 이미지 등록이 필요한 페이지에서 사용하는 API입니다. 이미지 등록이 필요한 페이지에서는 우선 서버에 이미지를 전송하면 숫자로 이루어진 filename을 포함하는 응답을 받을 수 있습니다. 그 filename을 다른 정보와 함께 서버에 전송해 줍니다.
 
예시 ) 프로필 등록 페이지에서의 사용 방법
  1. 이미지를 서버에 전송합니다.(POST /image/uploadfile)
  1. 숫자로 이루어진 filename을 응답받습니다. (2.png → 1640066364747.png)
  1. 다른 정보와 함께 서버에 전송합니다. (POST /user)
    1. filename은 “image”에 문자열로 전송합니다.
      { "user": { "_id": String, "email": String, "hearts": [], "isfollow": [], "following": [], "follower": [], "password": String, "username": String, "accountname": String, "intro": String, "image": String //http://146.56.183.55:5050/filename.이미지 확장자 } }
 

1.1 한 개의 이미지(프로필, 상품)

API

POST /image/uploadfile
method, 전송 url

Req

key : image value : 이미지 파일(*.jpg, *.gif, *.png, *.jpeg, *.bmp, *.tif)
body

Res

// SUCCESS { "fieldname": "image", "originalname": "2.png", "encoding": "7bit", "mimetype": "image/png", "destination": "uploadFiles/", "filename": "1640066364747.png", "path": "uploadFiles/1640066364747.png", "size": 47406 } // FAIL // 이미지 파일(*.jpg, *.gif, *.png, *.jpeg, *.bmp, *.tif) 확장자명이 다를 때 이미지 파일만 업로드가 가능합니다.
 

1.2 여러개의 이미지(포스트)

여러개의 이미지를 등록하는 방법도 한개의 이미지를 등록하는 방법과 동일합니다. 우선 이미지를 서버에 전송하고 숫자로 이루어진 filename을 응답받습니다. 단, 이때 응답 받은 filename을 서버에 다시 전송할 때는 하나의 문자열로 전송되어야 합니다.
예를 들어, “1640066364747.png”와 “1640066364748.png”를 동시에 전송할 때는 둘을 합친 문자열로 전송해야 합니다. 이미지 이름을 합칠 때는 따옴표나 다른 기호를 통해 구분하여 합치면 나중에 이미지를 가져올 때 쉽게 사용할 수 있습니다.
“1640066364747.png,1640066364748.png” 이렇게 ,(따옴표)로 구분하여 문자열을 전송한 후 이미지를 불러올 때는 따옴표를 기준으로 split하여 사용할 수 있습니다. 편한 방법을 통해 문자열을 분리하여 사용해 보세요.

API

여러 이미지는 3개까지 받을 수 있습니다.
POST /image/uploadfiles
method, 전송 url

Req

key : image value : 이미지 파일(*.jpg, *.gif, *.png, *.jpeg, *.bmp, *.tif)
body

Res

// SUCCESS { "fieldname": "image", "originalname": "2.png", "encoding": "7bit", "mimetype": "image/png", "destination": "uploadFiles/", "filename": "1640066364747.png", "path": "uploadFiles/1640066364747.png", "size": 47406 } // FAIL // 이미지 파일(*.jpg, *.gif, *.png, *.jpeg, *.bmp, *.tif) 확장자명이 다를 때 이미지 파일만 업로드가 가능합니다.
 

1.3 이미지 보기

API

GET http://146.56.183.55:5050/filename.이미지 확장자
method, 전송 url

Res

// SUCCESS
notion imagenotion image
// FAIL { "status":404 }
 

2. 유저

2.1 회원 가입

API

POST /user
method, 전송 url

Req

{ "user": { "username": String, "email": String, "password": String, "accountname": String, "intro": String, "image": String //http://146.56.183.55:5050/1641906557953.png 형식. } }
body(json)
{ "Content-type" : application/json }
header
  • email, password, accountname, username 은 필수로 작성해야 합니다.
  • email은 이메일 형식에 맞게 작성해야 합니다.
  • accountname은 영문자, 숫자, 점(.), 밑줄(_)만 포함해야 합니다.
  • image가 없을 경우 기본 이미지가 적용됩니다.
 

Res

// SUCCESS { "message": "회원가입 성공", "user": { "_id": String, "username": String, "email": String, "accountname": String, "intro": String, "image": String, } } // FAIL // email, password, accountname, username 중 하나라도 작성하지 않을 경우 필수 입력사항을 입력해주세요. // password를 6자 이상 입력하지 않을 경우 비밀번호는 6자 이상이어야 합니다. // eamil 형식이 잘못될 경우 잘못된 이메일 형식입니다. // 가입된 email일 경우 이미 가입된 이메일 주소입니다. // accountname에 지정된 문자 이외의 문자가 들어갈 경우 영문, 숫자, 밑줄, 마침표만 사용할 수 있습니다. // 가입된 accountname일 경우 이미 사용중인 계정 ID입니다.
 

2.2 로그인

API

POST /user/login
method, 전송 url

Req

{ "user":{ "email": String, "password": String } }
body(json)
{ "Content-type" : application/json }
header
  • email, password은 필수로 작성해야 합니다.

Res

// SUCCESS { "user": { "_id": String, "username": String, "email": String, "accountname": String, "image": String, "token": String } } // FAIL // email, password를 입력하지 않을 때 이메일 또는 비밀번호를 입력해주세요. // email를 입력하지 않을 때 이메일을 입력해주세요. // password를 입력하지 않을 때 비밀번호를 입력해주세요. // email, password를 일치하지 않을 때 이메일 또는 비밀번호가 일치하지 않습니다.
 

2.3 전체 유저 목록(개발용)

API

GET /user

Res

// SUCCESS [ { "user": { "_id": String, "email": String, "hearts": [], "following": [], "follower": [], "password": String, "username": String, "accountname": String, "intro": String, "image": String } } ]
 

2.4 이메일 검증

API

POST /user/emailvalid

Req

{ "user":{ "email":String } }
{ "Content-type" : application/json }
header

Res

// SUCCESS // 사용 가능한 이메일인 경우 { "message": "사용 가능한 이메일 입니다." } // 가입한 이메일이 있는 경우 { "message": "이미 가입된 이메일 주소 입니다." } // FAIL { "message": "잘못된 접근입니다." }
 

2.5 계정 검증

API

POST /user/accountnamevalid

Req

{ "user":{ "accountname":String } }
{ "Content-type" : application/json }
header

Res

// SUCCESS // 사용 가능한 계정ID인 경우 { "message": "사용 가능한 계정ID 입니다." } // 가입한 계정ID가 있는 경우 { "message": "이미 가입된 계정ID 입니다." } // FAIL { "message": "잘못된 접근입니다." }
 

3. 프로필

3.1 프로필 수정

API

PUT /user
method, 전송 url

Req

{ "user":{ "username": String, "accountname": String, "intro": String, "image": String } }
body(json)
{ "Authorization" : “Bearer key” "Content-type" : application/json }
header

Res

// SUCCESS { "user": { "_id": String, "username": String, "accountname": String, "intro": String, "image": String, "following": [], "follower": [], "followerCount": Number, "followingCount": Number } } // FAIL // 가입된 accountname일 경우 이미 사용중이 계정 ID입니다.
 

3.2 개인 프로필

API

GET /profile/:accountname
method, 전송 url

Req

{ "Authorization" : "Bearer key" "Content-type" : "application/json" }
header

Res

// SUCCESS { "profile": { "_id": String, "username": String, "accountname": String, "intro": String, "image": String, "isfollow": Boolean, "following": [], "follower": [], "followerCount": Number, "followingCount": Number } } // FAIL // 계정이 존재하지 않을 때 해당 계정이 존재하지 않습니다.
 

3.3 팔로우

API

POST /profile/:accountname/follow
method, 전송 url

Req

{ "Authorization" : “Bearer key” "Content-type" : application/json }
header

Res

// SUCCESS // follow 한 사용자의 프로필 { "profile": { "_id": String, "username": String, "accountname": String, "intro": String, "image": String, "isfollow": Boolean, "following": [], "follower": [ "접속한 사용자의 id" ], "followerCount": 1, "followingCount": 0 } } // FAIL // 계정이 존재하지 않을 때 해당 계정이 존재하지 않습니다.
// SUCCESS // 접속한 사용자의 프로필 { "profile": { "_id": String, "username": String, "accountname": String, "intro": String, "image": String, "isfollow": Boolean, "following": [ "팔로우 한 사용자의 id" ], "follower": [], "followerCount": 0, "followingCount": 1 } } // FAIL // 계정이 존재하지 않을 때 해당 계정이 존재하지 않습니다.
 

3.4 언팔로우

API

DELETE /profile/:accountname/unfollow
method, 전송 url

Req

{ "Authorization" : “Bearer key” "Content-type" : application/json }
header

Res

// SUCCESS // follow 한 사용자의 프로필 { "profile": { "_id": String, "username": String, "accountname": String, "intro": String, "image": String, "isfollow": Boolean, "following": [], "follower": [], "followerCount": 0, "followingCount": 0 } } // FAIL // 계정이 존재하지 않을 때 해당 계정이 존재하지 않습니다.
// SUCCESS // 접속한 사용자의 프로필 { "profile": { "_id": String, "username": String, "accountname": String, "intro": String, "image": String, "isfollow": Boolean, "following": [], "follower": [], "followerCount": 0, "followingCount": 0 } } // FAIL // 계정이 존재하지 않을 때 해당 계정이 존재하지 않습니다.
 

3.5 팔로잉 리스트(내가 팔로우한 사용자 목록)

API

GET /profile/:accountname/following // paging limit skip GET /profile/:accountname/following?limit=Number&skip=Number
method, 전송 url

Req

{ "Authorization" : “Bearer key” "Content-type" : application/json }
header

Res

// SUCCESS // following 한 사용자가 있을 때 [ { "_id": String, "username": String, "accountname": String, "intro": String, "image": String, "isfollow": Boolean, "following": [], "follower": [ "접속한 사용자의 id" ], "followerCount": 1, "followingCount": 0 } ] // following 한 사용자가 없을 때 [] // FAIL // 계정이 존재하지 않을 때 해당 계정이 존재하지 않습니다.
 

3.6 팔로워 리스트(나를 팔로우한 사용자 목록)

API

GET /profile/:accountname/follower // paging limit skip GET /profile/:accountname/follower/?limit=Number&skip=Number
method, 전송 url

Req

{ "Authorization" : “Bearer key” "Content-type" : "application/json" }
header

Res

// SUCCESS // follower 한 사용자가 있을 때 [ { "_id": String, "username": String, "accountname": String, "intro": String, "image": String, "isfollow": Boolean, "following": [], "follower": [ "접속한 사용자의 id" ], "followerCount": 1, "followingCount": 0 } ] // follower 한 사용자가 없을 때 [] // FAIL // 계정이 존재하지 않을 때 해당 계정이 존재하지 않습니다.
 

4. 검색

4.1 유저 검색

API

GET /user/searchuser/?keyword=keyword
method, 전송 url
  • keyword에 검색어를 입력합니다.
  • keyword에는 accountname, username을 검색할 수 있습니다.

Req

{ "Authorization" : “Bearer key” "Content-type" : application/json }
header

Res

// SUCCESS [ { "_id": String, "username": String, "accountname": String, "following": [], "follower": [], "followerCount": Number, "followingCount": Number } ]
 

5. 게시글

5.1 게시글 작성

API

POST /post
method, 전송 url

Req

{ "post": { "content": String, "image": String //"imageurl1", "imageurl2" 형식으로 } }
body(json)
{ "Authorization" : “Bearer key” "Content-type" : application/json }
header

Res

// SUCCESS { "post": [ { "id": String, "content": String, "image": String, "createdAt": String, "updatedAt": String, "hearted": false, "heartCount": 0, "commentCount": 0, "author": { "_id": "작성자 id", "username": "2", "accountname": "2", "following": [], "follower": [ "follower id" ], "followerCount": 1, "followingCount": 0 } } ] } // FAIL // 내용 또는 이미지를 입력하지 않을 때 내용 또는 이미지를 입력해주세요.
 

5.2 팔로워 게시글 목록(피드)

API

GET /post/feed // paging limit skip GET /post/feed/?limit=Number&skip=Number
method, 전송 url

Req

{ "Authorization" : "Bearer {token}" "Content-type" : "application/json" }
header

Res

// SUCCESS // follow 한 사용자가 있을 때 { "post": [ { "id": String, "content": "안녕하세요. 2 입니다.", "image": String, "createdAt": String, "updatedAt": String, "hearted": false, "heartCount": 0, "commentCount": 0, "author": { "_id": "작성자 id", "username": "2", "accountname": "2", "following": [], "follower": [ "follower id" ], "followerCount": 1, "followingCount": 0 } } ] } // follow 한 사용자가 없을 때 { "post": [] }
 

5.3 나의 게시글 목록

API

GET /post/:accountname/userpost // paging limit skip GET /post/:accountname/userpost/?limit=Number&skip=Number
method, 전송 url

Req

{ "Authorization" : “Bearer key” "Content-type" : application/json }
header

Res

// SUCCESS { "post": [ { "id": String, "content": "안녕하세요. 2 입니다.", "image": String, "createdAt": String, "updatedAt": String, "hearted": false, "heartCount": 0, "commentCount": 0, "author": { "_id": "작성자 id", "username": "2", "accountname": "2", "following": [], "follower": [ "follower id" ], "followerCount": 1, "followingCount": 0 } } ] } // 해당 계정의 게시물이 존재하지 않을 때 { "post":[] } // FAIL // 해당 계정이 존재하지 않을 때 해당 계정이 존재하지 않습니다.
 

5.4 게시글 상세

API

GET /post/:post_id
method, 전송 url

Req

{ "Authorization" : “Bearer key” "Content-type" : "application/json" }
header

Res

// SUCCESS { "post": [ { "id": String, "content": String, "image": String, "createdAt": String, "updatedAt": String, "hearted": false, "heartCount": 0, "commentCount": 0, "author": { "_id": "작성자 id", "username": "2", "accountname": "2", "following": [], "follower": [ "follower id" ], "followerCount": 1, "followingCount": 0 } } ] } // FAIL // 게시글이 존재하지 않을 때 존재하지 않는 게시글입니다.
 

5.5 게시글 수정

API

PUT /post/:post_id
method, 전송 url

Req

{ "post": { "content": String, "image": String } }
body(json)
{ "Authorization" : “Bearer key” "Content-type" : "application/json" }
header

Res

// SUCCESS { "post": [ { "id": String, "content": String, "image": String, "createdAt": String, "updatedAt": String, "hearted": false, "heartCount": 0, "commentCount": 0, "author": { "_id": "작성자 id", "username": "2", "accountname": "2", "following": [], "follower": [ "follower id" ], "followerCount": 1, "followingCount": 0 } } ] } // FAIL // 게시글이 존재하지 않을 때 존재하지 않는 게시글입니다. // 다른 사용자가 해당 게시물을 수정할 경우 잘못된 요청입니다. 로그인 정보를 확인하세요.
 

5.6 게시글 삭제

API

DELETE /post/:post_id
method, 전송 url

Req

{ "Authorization" : “Bearer key” "Content-type" : application/json }
header

Res

// SUCCESS 삭제되었습니다. // FAIL // 게시글이 존재하지 않을 때 존재하지 않는 게시글입니다. // 다른 사용자가 해당 게시물을 수정할 경우 잘못된 요청입니다. 로그인 정보를 확인하세요.
 

5.7 게시글 신고

API

POST /post/:post_id/report
method, 전송 url

Req

{ "Authorization" : “Bearer key” "Content-type" : "application/json" }
header

Res

// SUCCESS { "report": { "post": "포스트 id" } } // FAIL // 게시글이 존재하지 않을 때 존재하지 않는 게시글입니다.
 

6. 좋아요

6.1 좋아요

API

POST /post/:post_id/heart
method, 전송 url

Req

{ "Authorization" : “Bearer key” "Content-type" : application/json }
header

Res

// SUCCESS { "post": { "id": String, "content": String, "createdAt": String, "updatedAt": String, "hearted": true, "heartCount": 1, "commentCount": 0, "author": { "_id": "작성자 id", "username": "2", "accountname": "2", "intro": "2", "image": "2", "following": [], "follower": [ "팔로워 한 사용자의 id" ], "followerCount": 1, "followingCount": 0 } } } // FAIL // 게시글이 존재하지 않을 때 존재하지 않는 게시글입니다.
 

6.2 좋아요 취소

API

DELETE /post/:post_id/unheart
method, 전송 url

Req

{ "Authorization" : “Bearer key” "Content-type" : application/json }
header

Res

// SUCCESS { "post": { "id": "61c0252b8ec189519824a9b1", "content": "2@naver.com", "createdAt": "2021-12-20T06:39:39.929Z", "updatedAt": "2021-12-20T08:05:12.727Z", "hearted": false, "heartCount": 0, "commentCount": 0, "author": { "_id": "작성자 id", "username": "2", "accountname": "2", "intro": "2", "image": "2", "following": [], "follower": [ "팔로워 한 사용자의 id" ], "followerCount": 1, "followingCount": 0 } } } // FAIL // 게시글이 존재하지 않을 때 존재하지 않는 게시글입니다.
 

7. 댓글

7.1 댓글 작성

API

POST /post/:post_id/comments
method, 전송 url

Req

{ "comment":{ "content":String } }
body(json)
{ "Authorization" : “Bearer key” "Content-type" : application/json }
header

Res

// SUCCESS { "comment": { "id": Sting, "content": Sting, "createdAt": Sting, "author": { "_id": "작성자 id", "username": "1", "accountname": "1", "intro": "1", "image": "1", "following": [], "follower": [], "followerCount": 0, "followingCount": 0 } } } // FAIL // 게시물이 존재하지 않을 때 존재하지 않는 게시글입니다. // 댓글을 입력하지 않을 때 댓글을 입력해주세요.
 

7.2 댓글 리스트

API

GET /post/:post_id/comments // paging limit skip GET /post/:post_id/comments/?limit=Number&skip=Number
method, 전송 url

Req

{ "Authorization" : “Bearer key” "Content-type" : application/json }
header

Res

// SUCCESS // 댓글이 존재하는 경우 { "comment": [ { "id": String, "content": String, "createdAt": "2021-12-20T06:10:26.803Z", "author": { "_id": "작성자 id", "username": "1", "accountname": "1", "intro": "1", "image": "1", "following": [], "follower": [], "followerCount": 0, "followingCount": 0 } } ] } // 댓글이 존재하지 않는 경우 { "comment": [] } // FAIL // 게시물이 존재하지 않을 때 존재하지 않는 게시글입니다.
 

7.3 댓글 삭제

API

DELETE /post/:post_id/comments/:comment_id
method, 전송 url

Req

{ "Authorization" : “Bearer key” "Content-type" : application/json }
header

Res

// SUCCESS 댓글이 삭제되었습니다. // FAIL // 게시글이 존재하지 않을 때 존재하지 않는 게시글입니다. // 댓글이 존재하지 않을 때 댓글이 존재하지 않습니다.
 

7.4 댓글 신고

API

POST /post/:post_id/comments/:comment_id/report
method, 전송 url

Req

{ "Authorization" : “Bearer key” "Content-type" : application/json }
header

Res

// SUCCESS { "report": { "comment": "댓글 id" } } // FAIL // 게시글이 존재하지 않을 때 존재하지 않는 게시글입니다. // 댓글이 존재하지 않을 때 댓글이 존재하지 않습니다.
 

8. 상품

8.1 상품 등록

API

POST /product
method, 전송 url

Req

{ "product":{ "itemName": String, "price": Number, "link": String, "itemImage": String } }
body(json)
{ "Authorization" : “Bearer key” "Content-type" : application/json }
header

Res

// SUCCESS { "product": { "id": String, "itemName": String, "price": Number, "link": String, "itemImage": String, "author": { "_id": "작성자 id", "username": "2", "accountname": "2", "intro": "2", "image": "2", "following": [], "follower": [ "팔로워 한 사용자의 id" ], "followerCount": 1, "followingCount": 0 } } } // FAIL // itemName, price, link, itemImage 중 하나라도 입력하지 않았을 때 필수 입력사항을 입력해주세요. // price를 String으로 입력했을 때 가격은 숫자로 입력하셔야 합니다.
 

8.2 상품 리스트

API

GET /product/:accountname // paging limit skip GET /product/:accountname/?limit=Number&skip=Number
method, 전송 url

Req

{ "Authorization" : “Bearer key” "Content-type" : "application/json" }
header

Res

// SUCCESS // 상품이 있을 때 { "data" : Number, "product": [ { "id": String, "itemName": String, "price": Number, "link": String, "itemImage": String, "author": { "_id": "작성자 id", "username": "2", "accountname": "2", "intro": "2", "image": "2", "following": [], "follower": [ "팔로워 한 사용자의 id" ], "followerCount": 1, "followingCount": 0 } } ] } // 상품이 없을 때 { "data" : 0, "product": [] }
 

8.3 상품 상세

API

GET /product/detail/:product_id

Req

{ "Authorization" : “Bearer key” "Content-type" : "application/json" }
header

Res

// SUCCESS { "product":{ "id": String, "itemName": String, "price": Number, "link": String, "itemImage": String, "author": { "_id": "작성자 id", "username": "2", "accountname": "2", "intro": "2", "image": "2", "following": [], "follower": [ "팔로워 한 사용자의 id" ], "followerCount": 1, "followingCount": 0 } } }
 

8.4 상품 수정

API

PUT /product/:product_id
method, 전송 url

Req

{ "product": { "itemName": String, "price": Number, "link": String, "itemImage": String } } }
body(json)
{ "Authorization" : “Bearer key” "Content-type" : "application/json" }
header

Res

// SUCCESS { "product": { "id": String, "itemName": String, "price": Number, "link": String, "itemImage": String, "author": { "_id": "작성자 id", "username": "2", "accountname": "2", "intro": "2", "image": "2", "following": [], "follower": [ "팔로워 한 사용자의 id" ], "followerCount": 1, "followingCount": 0 } } } // FAIL // 상품이 없을 때 등록된 상품이 없습니다. // 상품을 등록한 사용자가 아닐 때 잘못된 요청입니다. 로그인 정보를 확인하세요.
 

8.5 상품 삭제

API

DELETE /product/:product_id
method, 전송 url

Req

{ "Authorization" : “Bearer key” "Content-type" : "application/json" }
header

Res

// SUCCESS 삭제되었습니다. // FAIL // 상품이 없을 때 등록된 상품이 없습니다. // 상품을 등록한 사용자가 아닐 때 잘못된 요청입니다. 로그인 정보를 확인하세요.
 

9. 토큰 검증

API

GET user/checktoken

Req

{ "Authorization" : “Bearer key” "Content-type" : "application/json" }
header

Res

// 토큰의 유저가 DB에 존재하는 경우 { "isValid":true } // 토큰의 유저가 DB에 존재하지 않는 경우 { "isValid":false }
 

정말 모르실 때 한 번 보세요.
0111~0112 특강코드(가이드라인)