Comments
Comment management
Retrieves all comments for a specific product.
Authorizations
Path parameters
productIdstringRequired
The ID of the product.
Responses
200
A list of comments.
application/json
401
Unauthorized.
404
Not found.
get
/comments/product/{productId}GET /api/v1/comments/product/{productId} HTTP/1.1
Host: localhost:3000
Accept: */*
{
"comments": [
{
"_id": "text",
"productId": "text",
"userId": "text",
"content": "text",
"createdAt": "2025-10-21T05:57:59.997Z",
"updatedAt": "2025-10-21T05:57:59.997Z"
}
]
}
Creates a new comment for a product.
Authorizations
Path parameters
productIdstringRequired
The ID of the product to comment on.
Body
contentstringRequired
The content of the comment.
Responses
201
Comment created successfully.
application/json
400
Bad request (e.g., invalid input).
401
Unauthorized.
404
Not found.
post
/comments/product/{productId}POST /api/v1/comments/product/{productId} HTTP/1.1
Host: localhost:3000
Content-Type: application/json
Accept: */*
Content-Length: 18
{
"content": "text"
}
{
"_id": "text",
"productId": "text",
"userId": "text",
"content": "text",
"createdAt": "2025-10-21T05:57:59.997Z",
"updatedAt": "2025-10-21T05:57:59.997Z"
}
Deletes a comment by its ID.
Authorizations
Path parameters
commentIdstringRequired
The ID of the comment to delete.
Responses
204
Comment deleted successfully.
No content
401
Unauthorized.
403
Forbidden.
404
Not found.
delete
/comments/{commentId}DELETE /api/v1/comments/{commentId} HTTP/1.1
Host: localhost:3000
Accept: */*
No content