Comments Feature
The Comments feature enables threaded discussions on posts.
Creating Comments
Basic Comment
The Comments API uses api/Comment. Create a comment:
POST /api/Comment
Authorization: Bearer {token}
Content-Type: application/json
{
"postId": "post-guid",
"content": "This is a great post!",
"parentCommentId": null
}
Nested Comments (Replies)
Reply to an existing comment:
POST /api/Comment
{
"postId": "post-guid",
"content": "I agree!",
"parentCommentId": "comment-id-here"
}
Viewing Comments
Get All Comments for a Post
GET /api/Comment/{postId}/comments?page=1&limit=20
Get Comment Thread
GET /api/Comment/{commentId}/thread
Comment Interactions
Reacting to Comments
POST /api/Reaction // or comment-specific reaction endpoint
{
"targetId": "comment-id",
"targetType": "Comment",
"type": "like"
}
Editing Comments
PUT /api/Comment/{commentId}
{
"content": "Updated comment text"
}
Deleting Comments
DELETE /api/Comment/{commentId}
Real-time Updates
Comments support real-time updates via WebSocket:
- New comments appear instantly
- Comment reactions update in real-time
- Typing indicators for comment composition