Strapi REST API (4.3.9)
Download OpenAPI specification:Download
The REST API allows accessing the content-types through API endpoints. Strapi automatically creates API endpoints when a content-type is created. API parameters can be used when querying API endpoints to refine the results.
Update a post
A complete replacement of a post with id.
path Parameters
id required | string The postId requested by user. |
Request Body schema: application/json
id required | string The post id. |
userId required | string The post userId. |
title required | string The title of the post |
body required | string The body content of the post |
Responses
Request samples
- Payload
Content type
application/json
{- "userId": 1,
- "id": 1,
- "title": "The First Post",
- "body": "we are building a blog post API using OpenAPI Specification."
}
Update a post
Update the post with id partially.
path Parameters
id required | string The postId requested by user. |
Request Body schema: application/json
id | string The post id. |
userId | string The post userId. |
title | string The title of the post |
body | string The body content of the post |
Responses
Request samples
- Payload
Content type
application/json
{- "id": "string",
- "userId": "string",
- "title": "string",
- "body": "string"
}
Return comments
Return comments on a post with postId={id}.
query Parameters
postId | string The postId which we want the comments |
Responses
Response samples
- 200
Content type
application/json
[- {
- "postId": 1,
- "id": 1,
- "name": "id labore ex et quam laborum",
- "email": "Eliseo@gardner.biz",
- "body": "laudantium enim quasi est quidem magnam voluptate"
}, - {
- "postId": 1,
- "id": 2,
- "name": "quo vero reiciendis velit similique earum",
- "email": "Jayne_Kuhic@sydney.com",
- "body": "est natus enim nihil est dolore omnis voluptatem"
}, - {
- "postId": 1,
- "id": 3,
- "name": "odio adipisci rerum aut animi",
- "email": "Nikita@garfield.biz",
- "body": "quia molestiae reprehenderit quasi aspernatur"
}
]