Skip to content

API Documents

Jin Young Park edited this page Nov 18, 2020 · 6 revisions

API ์„ค๊ณ„

User API๋ฅผ ์ œ์™ธํ•œ ๋ชจ๋“  API์— header๋กœ ์ธ์ฆ token๊ฐ’์„ ๋„ฃ๋Š”๋‹ค.

headers:{
 'Authorization': 'Bearer ${tokenString}'
}

Method url description
GET api/user/oauth/naver naver ์•„์ด๋””๋กœ ๋กœ๊ทธ์ธ
GET api/user/me ์‚ฌ์šฉ ์ค‘์ธ user์˜ ์ •๋ณด ํ™•์ธ

Project CRUD

Method url description
GET api/project project ์ „์ฒด ์กฐํšŒ
GET api/project/:projectId project ๊ฐœ๋ณ„ ์กฐํšŒ
POST api/project project ์ƒ์„ฑ
PATCH api/project/:projectId project ์ œ๋ชฉ ์ˆ˜์ •
PUT api/project/:projectId project ์ˆ˜์ •
DELETE api/project/:projectId project ์‚ญ์ œ

Section CUD

Method url description
POST api/project/:projectId/section section ์ƒ์„ฑ
PATCH api/project/:projectId/section/:sectionId section ์ œ๋ชฉ ์ˆ˜์ •
DELETE api/project/:projectId/section/:sectionId section ์‚ญ์ œ

Project

Project CRUD

Method url description
GET /api/task/:taskId task ๊ฐœ๋ณ„ ์กฐํšŒ
POST api/task task ์ƒ์„ฑ
PATCH api/task/:taskId task ์ˆ˜์ •
DELETE api/task/:taskId task ์‚ญ์ œ

Alarm CRUD

Method url description
POST /api/task/:taskId/alarm ๊ฐœ๋ณ„ task ์•Œ๋žŒ ์ถ”๊ฐ€
PUT /api/task/:taskId/alarm ๊ฐœ๋ณ„ task ์•Œ๋žŒ ๋ณ€๊ฒฝ
DELETE /api/task/:taskId/alarm ๊ฐœ๋ณ„ task ์•Œ๋žŒ ์‚ญ์ œ

Comment CUD

Method URL Description
GET /api/task/:taskId/comment task์— ๋‹ฌ๋ฆฐ ๋ชจ๋“  comment ์กฐํšŒ
POST /api/task/:taskId/comment task์— comment ์ƒ์„ฑ
PUT /api/task/:taskId/comment/:commentId task์— ๋‹ฌ๋ฆฐ comment ์ˆ˜์ •
DELETE /api/task/:taskId/comment/:commentId task์— ๋‹ฌ๋ฆฐ comment ์‚ญ์ œ

Bookmark CRUD

Method URL Description
GET /api/task/:taskId/bookmark bookmark ์ „์ฒด ์กฐํšŒ
POST /api/task/:taskId/bookmark bookmark ์ƒ์„ฑ
PUT /api/task/:taskId/bookmark/:bookmarkId bookmark ์ˆ˜์ •
DELETE /api/task/:taskId/bookmark/:bookmarkId bookmark ์‚ญ์ œ

Task GET API

URL

GET /api/task/:taskId

Response

{
    id : 1,
    title: '์ž‘์—…1',
    labels: [{id: 1, title: 'FE'},],
    priority: {id: 1, title: '์šฐ์„ ์ˆœ์œ„1'},
    alarm: { ... },
    dueDate: '2020-11-18',
    createdAt: '2020-11-18T07:12:41.000Z',
    updatedAt: '2020-11-18T07:12:41.000Z'
    childTasks: [{id: 2, title: ...},{}, ...],
}

Task Post API

URL

POST /api/task

Request

{
    title : 'ํ• ์ผ',
    projectId: 1,
    labelIdList: [1,2,3],
    priorityId: 1,
    alarm: {...},
    dueDate: '2020-11-18',
    parentId: 3
}

Response

{
    id: 1,
    message: 'ok'
}

Task Patch API

URL

PATCH /api/task/:taskId

Request

{
    title : 'ํ• ์ผ ๋ณ€๊ฒฝ' || undefined,
    dueDate: '2020-11-19' || undefined,
    projectId: 1 || undefined,
    labelIds: [1, 2, 3] || undefined,
    priority: 3 || undefined,
    parentId : 1 || undefined,
}

Response

{
    message: 'ok'
}

Task Delete API

URL

DELETE /api/task/:taskId

Response

{
    message: 'ok'
}

Task - Alarm Post API

URL

POST /api/task/:taskId/alarm

Request

Response

Task - Alarm Put API

URL

PUT /api/task/:taskId/alarm

Request

Response

Task - Alarm Delete API

URL

DELETE /api/task/:taskId/alarm

Response

Task - Comment Get API

URL

GET /api/task/:taskId/comment

Response

{
    comments:
    [
        {
            id: 1,
            content: 'https://...'
        }
    ]
}

Task - Comment Post API

URL

POST /api/task/:taskId/comment

Request

{
    content : '[๋‚ด์ผ ๋ด์•ผํ•  ๊ฒƒ](https://www.naver.com) ๊ณต๋ถ€ํ•˜์ž!'
}

Response

{
    id: 1,
    message: 'ok'
}

Task - Comment PUT API

URL

PUT /api/task/:taskId/comment/:commentId

Request

{
    'content': '์ฝ”๋ฉ˜ํŠธ ์ˆ˜์ •'
}

Response

{
    'message': 'ok'
}

Task - Comment DELETE API

URL

DELETE /api/task/:taskId/comment/:commentId

Response

{
    'message': 'ok'
}

Task - Bookmark Get API

URL

GET /api/task/:taskId/bookmark

Response

{
    bookmarks:
    {
        id: 1,
        url: 'https://....'
    }
}

Task - Bookmark Post API

URL

POST /api/task/:taskId/bookmark

Request

{
    url : 'https://...'
}

Response

{
    id: 1,
    message: 'ok'
}

Task - Bookmark PUT API

URL

PUT /api/task/:taskId/bookmark/:bookmarkId

Request

{
    url : 'https://another...'
}

Response

{
    'message': 'ok'
}

Task - Bookmark DELETE API

URL

DELETE /api/task/:taskId/bookmark/:bookmarkId

Response

{
    'message': 'ok'
}
Method URL Description
GET api/label label ์ „์ฒด ์กฐํšŒ
POST api/label label ์ƒ์„ฑ
PUT api/label/:labelId label ์ˆ˜์ •
DELETE api/label/:labelId label ์‚ญ์ œ
Clone this wiki locally