Back to top

測試 Aglio 用的 API 文件

內容

  • 這裡可以對這份文件做一點說明,可能包含 API 相關的一些限制和規定

  • 可以使用包含程式碼區塊的 Markdown 語法

{
    "result": true,
    ...
}

文章

文章 API

Create Post

Create Post
POST/api/post/

create post

Example URI

POST https://aglio.practice/api/post/
Request
HideShow
Headers
Content-Type: application/json
Body
{
  "title": "test",
  "content": "This is a test post."
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 1,
  "title": "test",
  "content": "This is a test post.",
  "created_at": "2020/11/11"
}

Other Post api

Get Post
GET/api/post/{id}

get post

Example URI

GET https://aglio.practice/api/post/1
URI Parameters
HideShow
id
integer (required) Example: 1

post id

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 1,
  "title": "test",
  "content": "This is a test post.",
  "created_at": "2020/11/11"
}

Update Post
PUT/api/post/{id}

get post

Example URI

PUT https://aglio.practice/api/post/1
URI Parameters
HideShow
id
integer (required) Example: 1

post id

Request
HideShow
Headers
Content-Type: application/json
Body
{
  "title": "test_updated",
  "content": "This is a test updated post"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 1,
  "title": "test_updated",
  "content": "This is a test updated post",
  "created_at": "2020/11/11"
}

Delete Post
DELETE/api/post/{id}

delete post

Example URI

DELETE https://aglio.practice/api/post/1
URI Parameters
HideShow
id
integer (required) Example: 1

post id

Response  200

Generated by aglio on 13 Nov 2020