Operation/Rest API

Markdown์œผ๋กœ Rest API ๋ฌธ์„œํ™”ํ•˜๊ธฐ !

JaeHoney 2021. 12. 25. 13:06

๐Ÿ“ markdown-api-docs

API ๋ฌธ์„œ, API Reference, API docs๋ฅผ ์ž‘์„ฑํ•˜์‹ค ๋•Œ ๊นƒํ—ˆ๋ธŒ(Git hub)๋‚˜ ๊นƒ๋žฉ(Git lab)์— markdown์œผ๋กœ ์ž‘์„ฑํ•œ ํ…œํ”Œ๋ฆฟ์„ ๊ณต์œ ํ•˜๊ณ ์ž ํ•ฉ๋‹ˆ๋‹ค.

 

Source : https://github.com/violetbeach/markdown-api-docs

๐Ÿ“š API ์„ค๊ณ„

API Reference

 

์ž์›
/resources

์ž์› ๋“ฑ๋ก

์ƒˆ๋กœ์šด ์ž์›์„ ๋“ฑ๋กํ•ฉ๋‹ˆ๋‹ค.

  • URL
  • /resources
  • Method:
  • POST
  • Data Paramsname=[String] - ์ž์›๋ช…
    count=[Integer] - ์ˆ˜๋Ÿ‰description=[String] - ์ž์› ์„ค๋ช…
  • Optional:
  • Required:
  • Responseid=[String] - ์ž์› ์ผ๋ จ๋ฒˆํ˜ธ
    name=[String] - ์ž์›๋ช…
    description=[String] - ์ž์› ์„ค๋ช…
    count=[Integer] - ์ˆ˜๋Ÿ‰
    created_at=[Date] - ์ƒ์„ฑ ์ผ์ž
  • Required:
  • Success Response:
  • HTTP/1.1 201 Created Content-type: application/json;charset=UTF-8 { "id": "1", "name": "ํœด๋Œ€ํฐ", "description": "์•„์ดํฐ12", "count": 1, "created_at": "2018-07-04 14:00:00" }
/resources/{id}

์ž์› ์ƒ์„ธ ์กฐํšŒ

์ž์›์„ ์ƒ์„ธ ์กฐํšŒํ•ฉ๋‹ˆ๋‹ค.

  • URL
  • /resources/:id
  • Method:
  • GET
  • ResponseOptional:
  • Required:
    id=[String] - ์ž์› ์ผ๋ จ๋ฒˆํ˜ธ
    name=[String] - ์ž์›๋ช…
    description=[String] - ์ž์› ์„ค๋ช…
    count=[Integer] - ์ˆ˜๋Ÿ‰
  • Success Response:
  • HTTP/1.1 200 OK Content-type: application/json;charset=UTF-8 { "id": "1", "name": "ํœด๋Œ€ํฐ", "description": "์•„์ดํฐ", "count": 1, }

์ž์› ์‚ญ์ œ

ํŠน์ • ์ž์›์„ ์‚ญ์ œํ•ฉ๋‹ˆ๋‹ค.

  • URL
  • /resources/:id
  • Method:
  • DELETE
  • Success Response:
  • HTTP/1.1 204 No Content
์—๋Ÿฌ ์ฝ”๋“œ

HTTP ์ƒํƒœ ์ฝ”๋“œ

  • Response
  • code=[Integer] - ์—๋Ÿฌ ์ฝ”๋“œ
    message=[String] - ์—๋Ÿฌ ๋ฉ”์‹œ์ง€
  • Success Response:
  • HTTP/1.1 401 Unauthorized { "errors": [ { "status": "401", "message": "Unauthorized" } ] }