Comments

Comment management

Get comments by product

get
/comments/product/{productId}

Retrieves all comments for a specific product.

Authorizations
Path parameters
productIdstringRequired

The ID of the product.

Responses
200

A list of comments.

application/json
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"
    }
  ]
}

Create a comment

post
/comments/product/{productId}

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
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"
}

Delete a comment

delete
/comments/{commentId}

Deletes a comment by its ID.

Authorizations
Path parameters
commentIdstringRequired

The ID of the comment to delete.

Responses
204

Comment deleted successfully.

No content

delete
/comments/{commentId}
DELETE /api/v1/comments/{commentId} HTTP/1.1
Host: localhost:3000
Accept: */*

No content