Skip to main content

Get Comment By ID

GET /post/comment/:commentId

Description

Returns a single comment by ID.

Request Parameters

Requires Authentication: true

PATH PARAMS

NameTypeRequiredDescription
commentIdstringYesMongoDB comment ID.

Success Response

{
"message": "Comment fetched successfully",
"data": {
"_id": "66ef265c8f073b81cb3b3900",
"postId": "66cbbea31e854f3d7995c1f0",
"comment": "Nice post"
}
}

Error Response

CodeDescription
401Invalid comment ID or missing auth
404Comment or post not found
500Server error