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}'
}

User

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

User GET API (naver ์•„์ด๋””๋กœ ๋กœ๊ทธ์ธ)

URL

GET /api/user/oauth/

redirect URL์˜ query๊ฐ’์œผ๋กœ token์ด ๋„˜์–ด์˜จ๋‹ค.

User GET API (์‚ฌ์šฉ์ค‘์ธ user์˜ ์ •๋ณด ํ™•์ธ)

URL

GET /api/user/me

Response

{
    id: 1,
    name: "tony",
    email: "aaa@aaa",
}

Project

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 GET API (ํ”„๋กœ์ ํŠธ ์ „์ฒด ์กฐํšŒ)

URL

GET /api/project

Response

[
    {
        id : 1,
        title: 'ํ”„๋กœ์ ํŠธ ์ด๋ฆ„',
        taskCount: 3    
    }
]

Project GET API (ํ”„๋กœ์ ํŠธ ๊ฐœ๋ณ„ ์กฐํšŒ)

URL

GET /api/project/:projectId

Response

{
    id : 1,
    title: 'ํ”„๋กœ์ ํŠธ ์ด๋ฆ„',
    type: 'list || board',
    sections: 
    [
        {
            id: 1,
            tasks: 
            [
                {
                    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: ...},{}, ...],
                }
            ]
        }
    ]
    
}

Project Post API

URL

POST /api/project

Request

{
    title : 'ํ”„๋กœ์ ํŠธ ์ด๋ฆ„',
    type: 'list || board',
    isFavorite : true || false
}

Response

{
    message: 'ok',
    id: 1,
}

Project Patch API

URL

Patch /api/project/:projectID

Request

{
    title : '์ƒˆ๋กœ์šด ํ”„๋กœ์ ํŠธ ์ด๋ฆ„', 
}

Response

{
    message: 'ok'
}

Project Put API

URL

PUT /api/project/projectId

Request

{
    title : 'ํ”„๋กœ์ ํŠธ ์ด๋ฆ„',
    type: 'list || board',
    isFavorite : true || false
}

Response

{
    message: 'ok'
}

Project Delete API

URL

DELETE /api/project/:projectId

Response

{
    message: 'ok'
}

Project - Section POST API

URL

POST /api/project/:projectId/section

Request

{
    title : '์ƒˆ๋กœ์šด ์„น์…˜ ์ด๋ฆ„', 
}

Response

{
    message: 'ok'
}

Project - Section PATCH API

URL

PATCH /api/project/:projectId/section/:sectionId

Request

{
    title : '์ƒˆ๋กœ์šด ์„น์…˜ ์ด๋ฆ„', 
}

Response

{
    message: 'ok'
}

Project - Section DELETE API

URL

DELETE /api/project/:projectId/section/:sectionId

Response

{
    message: 'ok'
}

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'
}

Project

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

Label Get API

URL

GET /api/label

Response

{
    labels:
    [
        {
            id: 1,
            title: '๋ผ๋ฒจ 1',
            color: '#FFFFFF'
        }
    ]
}

Label Post API

URL

POST /api/label

Request

{
    title : '๋ผ๋ฒจ 1',
    color : '#FFFFFF',
}

Response

{
    id : 1,
    message : 'ok'
}

Label Put API

URL

PUT /api/label/labelId

Request

{
    title : '๋ผ๋ฒจ 1',
    color : '#FFFFFF',
}

Response

{
    id : 1,
    message : 'ok'
}

Label Delete API

URL

DELETE /api/label/:labelId

Response

    {
        message:' ok'
    }
Clone this wiki locally