Get comments for an article

GET /articles/{slug}/comments

Get the comments for an article. Auth is optional

Path parameters

  • slug string Required

    Slug of the article that you want to get comments for

Responses

  • 200 application/json

    OK

    Hide response attribute Show response attribute object
  • Unauthorized

  • 422 application/json

    Unexpected error

    Hide response attribute Show response attribute object
    • errors object Required
      Hide errors attribute Show errors attribute object
GET /articles/{slug}/comments
curl \
 --request GET '/api/articles/{slug}/comments'
Response examples (200)
{
  "comments": [
    {
      "id": 1,
      "body": "It takes a Jacobian",
      "author": {
        "bio": "I work at State Farm.",
        "image": "https://i.stack.imgur.com/xHWG8.jpg",
        "username": "jake",
        "following": false
      },
      "createdAt": "2021-02-18T03:22:56.637Z",
      "updatedAt": "2021-02-18T03:22:56.637Z"
    }
  ]
}
Response examples (422)
{
  "errors": {
    "body": [
      "string"
    ]
  }
}