Skip to content

api_spec

choisungwook edited this page Oct 25, 2021 · 29 revisions

๊ฐœ์š”

  • api ์ŠคํŽ™

ํšŒ์› API

ํšŒ์›๊ฐ€์ž…

  • api: /signup
  • http method: POST
  • ์š”์ฒญ ํ—ค๋”
Content-Type: application/json;charset=UTF-8
  • request_body
{
    "email": "hello@world.com",
    "password": "password",
    "nickname": "testuser"
}
  • ์„ฑ๊ณต ์‘๋‹ต
201 CREATED
{
  "id": "1" ; ์ƒ์„ฑ id
}

๋กœ๊ทธ์ธ

  • api: /login
  • http method: POST
  • ์š”์ฒญ ํ—ค๋”
Content-Type: application/json;charset=UTF-8
  • request_body
{ }
  • ์„ฑ๊ณต ์‘๋‹ต
    • status_code: 200 OK
    • cookie: ์„ธ์…˜id๊ฐ€ JSESSIONID๋กœ ๋ฆฌํ„ด

๋กœ๊ทธ์•„์›ƒ

  • api: /logout
  • http method: POST
  • ์š”์ฒญ ํ—ค๋”
Content-Type: application/json;charset=UTF-8
  • request_body
{
}
  • ์„ฑ๊ณต ์‘๋‹ต
200 OK

์นดํ…Œ๊ณ ๋ฆฌ ์กฐํšŒ

  • api: /category
  • http method: GET
  • ์š”์ฒญ ํ—ค๋”
Content-Type: application/json;charset=UTF-8

์นดํ…Œ๊ณ ๋ฆฌ ์ƒ์„ฑ

  • api: /category
  • http method: POST
  • ์š”์ฒญ ํ—ค๋”
Content-Type: application/json;charset=UTF-8
Authorization: "bearer <ํ† ํฐ>"
  • request_body
{
    "name": "",
    "parentId": 0L
}

์นดํ…Œ๊ณ ๋ฆฌ ์ˆ˜์ •

  • api: /category/{category_id}
  • http method: PUT
  • ์š”์ฒญ ํ—ค๋”
Content-Type: application/json;charset=UTF-8
Authorization: "bearer <ํ† ํฐ>"
  • request_body
{
    "name": "",
    "parentId": ""
}

์นดํ…Œ๊ณ ๋ฆฌ ์‚ญ์ œ

  • api: /category/{category_id}
  • http method: DELETE
  • ์š”์ฒญ ํ—ค๋”
Content-Type: application/json;charset=UTF-8
Authorization: "bearer <ํ† ํฐ>"

์ปค๋ฎค๋‹ˆํ‹ฐ ๊ฒŒ์‹œํŒ ์กฐํšŒ

  • api: /board
  • http method: GET
  • ์š”์ฒญ ํ—ค๋”
Content-Type: application/json;charset=UTF-8

์ปค๋ฎค๋‹ˆํ‹ฐ ํšŒ์›๋ณ„ ๊ฒŒ์‹œํŒ ์กฐํšŒ

  • api: /board/{account_id}
  • http method: GET
  • ์š”์ฒญ ํ—ค๋”
Content-Type: application/json;charset=UTF-8

์ปค๋ฎค๋‹ˆํ‹ฐ ํŠน์ • ๊ฒŒ์‹œ๋ฌผ ์กฐํšŒ

  • api: /board/{board_id}
  • http method: GET
  • ์š”์ฒญ ํ—ค๋”
Content-Type: application/json;charset=UTF-8

์ปค๋ฎค๋‹ˆํ‹ฐ ๊ฒŒ์‹œ๋ฌผ ์ž‘์„ฑ

  • api: /board
  • http method: POST
  • ์š”์ฒญ ํ—ค๋”
Content-Type: application/json;charset=UTF-8
Authorization: "bearer <ํ† ํฐ>"
  • request_body
{
    "content": "",
    "account": {}
}

์ปค๋ฎค๋‹ˆํ‹ฐ ๊ฒŒ์‹œ๋ฌผ ์ˆ˜์ •

  • api: /board/{board_id}
  • http method: PUT
  • ์š”์ฒญ ํ—ค๋”
Content-Type: application/json;charset=UTF-8
Authorization: "bearer <ํ† ํฐ>"
  • request_body
{
    "content": "",
}

์ปค๋ฎค๋‹ˆํ‹ฐ ๊ฒŒ์‹œ๋ฌผ ์‚ญ์ œ

  • api: /board/{board_id}
  • http method: DELETE
  • ์š”์ฒญ ํ—ค๋”
Content-Type: application/json;charset=UTF-8
Authorization: "bearer <ํ† ํฐ>"