-
Notifications
You must be signed in to change notification settings - Fork 6
API Documents
YUBEEN PARK / TRISHA edited this page Jul 20, 2021
·
4 revisions
๐ explore ํ์ด์ง ์กฐํ
- ๋นํ์ ์ ์ ๊ฐ ์ ์ฒด ์กฐํํ๋ ๊ฒฝ์ฐ
- explore ํ์ด์ง ํํ๋ฉด์์ ์กฐํ๋ ์ ์ฒด ๋ฐ์ดํฐ๋ฅผ ์๋ตํ๋ค.
- URL: /expore
- METHOD: GET
- Response
200 { users, "message": "welcome to explore" }
501 { "message": "failed"}
๐ ๋ก๊ทธ์ธ
- ์์๋น๋ฐ๋ฒํธ ๋ฐ๊ธ /auth/tmp
- METHOD: POST
- Request
{
email //user's email
}
- Response
200 { "message": "login failed" }
401 { "message" : "incorrect information" }
501 { "message" : "failed" }
- ๋น๋ฐ๋ฒํธ ์ด๊ธฐํ /auth/pwd
- METHOD: POST
- Request
{
tempPwd //temporary password
pwd //reset password
}
- Response
200 { "message" : "ok" }
422 { "message" : "incorrect information"}
500 { "message" : "failed" }
- ๋ก๊ทธ์ธ
- URL: /login
- METHOD: POST
- Request
{
email //user's email
pwd //user's password
}
๐ ๋ก๊ทธ์์
- URL: /logout
- METHOD: GET
- Response
200 { "message" : "ok" }
401 { "message" : "not our user" }
501 { "message" : "failed" }
๐ ํ์๊ฐ์
- URL: /signup
- METHOD: POST (1) ์ ์ ๋ค์ ์ค๋ณต ๊ฒ์ฌ /auth/username
- Response
200 { "message" : "valid username" }
422 { "message" : "incorrect information" }
409 { "message" : "already exists" }
501 { "message" : "failed" }
(2) ์ด๋ฉ์ผ ์ค๋ณต ๊ฒ์ฌ /auth/email
- Response
200 { "message" : "valid email" }
422 { "message" : "incorrect information" }
409 { "message" : "already exists" }
501 { "message" : "failed" }
access token ์ฌ๋ฐ๊ธ
- URL: /auth/token
- METHOD: GET
- Response
200 { "message": "login successfully" }
401 { "message" : "invalid refresh token" }
๐คํ๋กํ
ํ๋กํ ์กฐํ
- URL: /profile
- METHOD: GET
- Response
200 { "user" : user, "bookmark" : bookmark, "message" : "get profile successfully" }
401 { "message" : "invalid access token" }
500 { "message" : "failed" }
ํ๋กํ ์ญ์
- URL: /profile
- METHOD: DELETE
- Response
205 { "message" : "deleted account successfully" }
401 { "message" : "invalid access token" }
501 { "message" : "failed" }
ํ๋กํ ์์
- URL: /profile/username
- Request
- Content-Type: application/json
{ username: //changing username
}
- URL: /profile/pwd
- Request
- Content-Type: application/json
{ pwd: //current password
newPwd: //new password
}
- URL: /profile/gitRepo
- Request
- Content-Type: application/json
{
gitRepo: //changing gitRepo
}
- URL: /profile/company
- Request
- Content-Type: application/json
{
company: //changing company
}
Response
200 { "message" : "edited profile successfully" }
401 { "message" : "invalid access token" }
422 { "message" : "incorrect information" }
๐ก ์ฝ๋ ํธ ํ์ด์ง ์กฐํ
- ์ ์ฒด ์กฐํ
- ์ฝ๋ ํธ ํ์ด์ง ํํ๋ฉด์์ ์กฐํ๋ ์ ์ฒด ๋ฐ์ดํฐ๋ฅผ ์๋ตํ๋ค.
- URL: /collect
- METHOD: GET
- Content-Type: application/json
- Response
{
bookmarks: [],
category: ["db", "API"],
reducedbookmarks: [{
id: 13,
title: "Network",
bookmarks: [{
id: 1,
categoryId: 13
text: "what is the difference between http and https",
url:"https://www.google.com"
importance: 0
color:#f24626
visitCounts:0
position: 1, // ์นด๋ ์์น ์์
}, {
id: 2,
categoryId: 13
text: "response codes",
url:"https://app.gitbook.com/@recollect/s/recollect-final/#reset-password"
importance: 1
color:#f24626
visitCounts:0
position: 2,
}]
}, {
id: 24,
title: "NGINX",
bookmarks: [{
id: 3,
categoryId: 24
text: "nginx documents",
url:"http://nginx.org/en/docs/varindex.html"
importance: 1
color:#f24626
visitCounts:0
position: 3,
}, {
id: 4,
categoryId: 24
text: "nginx reverse proxy",
url:https://blog.webf.zone/ultimate-guide-to-http-cookies-2aa3e083dbae"
importance: 1
color:#f24626
visitCounts:0
position: 4,
}]
}],
"message" : "welcome to collect",
}
401 { "message" : "invalid access token" }
500 { "message" : "failed" }
๐ ์นดํ ๊ณ ๋ฆฌ
์นดํ ๊ณ ๋ฆฌ ์์
- URL: /category
- METHOD: PUT
- Content-Type: application/json
- Resonse
200 { "message" : "edited successfully" }
401 { "message" : "invalid access token" }
501 { "message" : "failed" }
์นดํ ๊ณ ๋ฆฌ ์ญ์
- URL: /category/:id
- METHOD: DELETE
- Response
200 { "message" : "deleted successfully" }
401 { "message" : "invalid access token" }
501 { "message" : "failed" }
๐ท ๋ถ๋งํฌ
๋ถ๋งํฌ ์ถ๊ฐ
- URL: /bookmark
- METHOD: POST
- Content-Type: application/json
- Request
{
category: NGINX,
text: "nginx reverse proxy",
url:https://blog.webf.zone/ultimate-guide-to-http-cookies-2aa3e083dbae"
importance: 1
color:#f24626
}
- Response
201 { "message" : "created successfully" }
401 { "message" : "invalid access token" }
501 { "message" : "failed" }
๋ถ๋งํฌ visitCount ์ถ๊ฐ
- URL: /bookmarks/:id
- METHOD: PATCH
๋ถ๋งํฌ ์์
- URL: /bookmarks/:id
- METHOD: PUT
- Request
- Content-Type: application/json
{
category: "NGINX,
text: "nginx reverse proxy",
url:https://blog.webf.zone/ultimate-guide-to-http-cookies-2aa3e083dbae",
importance: 1,
color:#f24626
}
- Response
200 { "message" : "edited successfully" }
401 { "message" : "invalid access token" }
422 { "message" : "incorrect information" }
501 { "message" : "failed" }
๋ถ๋งํฌ ํฌ์ง์ ํ๊ฐ ์์ : ์นดํ ๊ณ ๋ฆฌ์ ๋งจ ๋ง์ง๋ง์ผ๋ก ์ด๋๋๋ ๊ฒฝ์ฐ
- position์ ๊ฐ์ฅ ํฐ ๊ฐ์ผ๋ก ๋ฐ๊ฟ์ฃผ๋ API -> ๋ฐ๋ผ์ ์กฐํ์ ์ตํ๋จ์ ์ถ๋ ฅ๋๊ฒ ๋๋ค.
- URL: /bookmarks/:id/position
- METHOD: PATCH
- Request
- Content-Type: application/json
{ categoryId: 1 }
- Response
200 { "message" : "ok" }
401 { "message" : "invalid access token" }
422 { "message" : "incorrect information" }
501 { "message" : "failed" }
๋ถ๋งํฌ ํฌ์ง์ ์ ์ฒด ์์
- dragNo์ position์ dropNo์ position์ผ๋ก ๋ฐ๊ฟ์ค ๋ค, ํ์ ์นด๋๋ค์ ๋ชจ๋ position์ 1์ฉ ๋ํ๋ API
- URL: /bookmarks/:dragId/:dropId/position
- METHOD: PATCH
- Request
- Content-Type: application/json
{ categoryId: 1 }
- Response
200 { "message" : "ok" }
401 { "message" : "invalid access token" }
422 { "message" : "incorrect information" }
501 { "message" : "failed" }
๋ถ๋งํฌ ์ญ์
- URL: /bookmakrs/:id
- METHOD: DELETE
- Response
200 { "message" : "deleted successfully" }
401 { "message" : "invalid access token" }
422 { "message" : "incorrect information" }
501 { "message" : "failed" }