cURL
curl --request POST \ --url https://localhost:5000/comments/create/{post_id} \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data ' { "text": "<string>" } '
{ "success": true, "message": "Comment created successfully", "comment": { "text": "<string>", "author": "<string>", "post": "<string>", "_id": "<string>", "parentComment": "<string>", "replyTo": "<string>", "likes": [ "<string>" ], "repliesCount": 0, "createdAt": "2023-11-07T05:31:56Z", "updatedAt": "2023-11-07T05:31:56Z" } }
Create a new comment on a post
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Bearer <token>
<token>
Post ID
Comment text
Comment created successfully
true
"Comment created successfully"
Show child attributes