Skip to content

API 명세

woorimIT edited this page Jun 16, 2021 · 13 revisions

API 명세


🏡 홈

전체 조회

홈 화면에서 조회될 전체 데이터를 응답한다.
URL: /api/home
METHOD: GET

  • Response
    • Status: 200 OK
    • Content-Type: application/json
{
   lists: [{
      no: 13,
      title: "ToDo",
      cards: [{
         no: 1,
         content: "1일 1커밋"
      }, {
         no: 3,
         content: "문서 정리"
      }]
   }, {
      no: 21,
      title: "InProgress",
      cards: [{
         no: 2,
         content: "1일 1회화"
      }, {
         no: 3,
         content: "API 명세 정리"
      }]
   }]
}

📑 리스트

리스트 추가

URL: /api/list
METHOD: POST

  • Request
    • Content-Type: application/json
{
   title: "ToDo"
}
  • Response
    • Status: 201 Created
    • Content-Type: application/json
{
   result: "success",
   msg: "리스트가 성공적으로 추가되었습니다."
}

🔖 카드

카드 추가

URL: /api/card
METHOD: POST

  • Request
    • Content-Type: application/json
{
   content: "1일 1커밋"
}
  • Response
    • Status: 201 Created
    • Content-Type: application/json
{
   result: "success"
}

카드 수정

URL: /api/cards/:no
METHOD: PUT

  • Request
    • Content-Type: application/json
{
   content: "1일 1회화"
}
  • Response
    • Status: 204 No Content

카드 삭제

URL: /api/cards/:no
METHOD: DELETE

  • Response
    • Status: 204 No Content

🚫 에러 응답

404

(1) 존재하지 않는 URL에 접근했을 때
(2) 존재하지 않는 데이터에게 CRUD를 시도할 때 등

  • Status: 404 Not Found
  • Content-Type: application/json
{
   result: "error on client side"
   msg: "존재하지 않는 리소스입니다."
}

Clone this wiki locally