Create a comment for an article
Create a comment for an article. Auth is required
Path parameters
-
slug
string Required Slug of the article that you want to create a comment for
POST
/articles/{slug}/comments
curl \
--request POST '/api/articles/{slug}/comments' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--data '{"comment":{"body":"string"}}'
Request examples
{
"comment": {
"body": "string"
}
}
Response examples (200)
{
"comment": {
"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"
]
}
}