Return comments

GET /comments

Return comments on a post with postId={id}.

Query parameters

  • postId string

    The postId which we want the comments

Responses

  • 200

    A list of comments JSON format

    Hide response attributes Show response attributes array[object]
    • id string

      The comment id.

    • postId string

      The comment postId.

    • name string

      The name of the comment.

    • email string

      The email of the user who posted the comment.

    • body string

      The comment body.

GET /comments
curl \
 -X GET https://api.example.com/v1/comments
Response examples (200)
[
  {
    "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"
  }
]
Response examples (200)
[
  {
    "id": 1,
    "body": "laudantium enim quasi est quidem magnam voluptate",
    "name": "id labore ex et quam laborum",
    "email": "Eliseo@gardner.biz",
    "postId": 1
  },
  {
    "id": 2,
    "body": "est natus enim nihil est dolore omnis voluptatem",
    "name": "quo vero reiciendis velit similique earum",
    "email": "Jayne_Kuhic@sydney.com",
    "postId": 1
  },
  {
    "id": 3,
    "body": "quia molestiae reprehenderit quasi aspernatur",
    "name": "odio adipisci rerum aut animi",
    "email": "Nikita@garfield.biz",
    "postId": 1
  }
]