Endpoint
Authentication
Required. User must be authenticated to comment on a post.Path Parameters
The unique identifier of the post to comment on (PostID)
Request Body
The username of the authenticated user making the comment
The text content of the comment. Maximum length: 1000 characters
Behavior
- Creates a new Comment record
- Sets initial LikeCount to 0
- Creates a notification for the post owner
- Prevents commenting on posts from blocked accounts
Request
Response
201 Created - Comment added successfully
Unique identifier for the comment
ID of the post being commented on
ID of the user who made the comment
The text content of the comment
Timestamp when the comment was created
Number of likes on the comment (initially 0)
Errors
Post or account does not exist, or action cannot be completed due to a block