SuperDocs Demo

Get Post Comments

Retrieve all comments for a specific post

GET /posts/{id}/comments

Overview

Retrieves all comments associated with a specific blog post.

Path Parameters

Path Parameters

id required
integer

The ID of the post to get comments for

Response

Returns an array of comment objects.

id integer

Unique identifier for the comment

postId integer

ID of the post this comment belongs to

name string

Title or subject of the comment

email string

Email address of the commenter

body string

Content of the comment

Example Response

[
{
"postId": 1,
"id": 1,
"name": "id labore ex et quam laborum",
"email": "Eliseo@gardner.biz",
"body": "laudantium enim quasi est quidem magnam voluptate ipsam eos\ntempora quo necessitatibus\ndolor quam autem quasi\nreiciendis et nam sapiente accusantium"
},
{
"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 numquam\net omnis occaecati quod ullam at\nvoluptatem error expedita pariatur\nnihil sint nostrum voluptatem reiciendis et"
}
]

Get Post Details

View the full post that these comments belong to

Error Responses

StatusDescription
404Post not found - the specified post ID does not exist
Try it out
GET /posts/{id}/comments