Skip to main content

Retrieve Product Comment

Retrieves detailed information about a specific product comment by its ID.

HTTP Request

GET/api/products/comments/:id

Authorization

Authorization

  • Required: Yes
  • Permission: Staff or Admin
  • Authentication: Token-based (Authorization: Token <your_api_key>)

Path Parameters

ParameterTypeRequiredDescription
idintegerYesUnique ID of the product comment

Example Requests

1import requests
2
3response = requests.get('http://www.example.com/api/products/comments/123', 
4  headers={'Authorization': 'Token <your_api_key>'}
5)
6print(response.json())

Status Codes

CodeDescription
200Product comment retrieved successfully
401Unauthorized — authentication required
403Forbidden — insufficient permissions
404Product comment not found
500Internal server error

Response Fields

FieldTypeDescription
idintegerUnique ID of the comment
ratingintegerRating given (1-5: Worst, Bad, Average, Good, Best)
contentstringComment content (max 500 characters)
is_anonymousbooleanWhether the comment is posted anonymously
is_publishedbooleanWhether the comment is published
user_dataobjectUser details (read-only)
product_dataobjectProduct details (read-only)
truncated_contentstringShortened version of content
created_atstring (ISO 8601)Timestamp when comment was created
updated_atstring (ISO 8601)Timestamp when comment was last updated

User Data Structure

FieldTypeDescription
idintegerUnique ID of the user
usernamestringUsername of the user
full_namestringFull name of the user
avatarstringURL of the user avatar image

Product Data Structure

FieldTypeDescription
idintegerUnique ID of the product
namestringName of the product

Notes

  • This endpoint returns a single comment object with full details
  • Anonymous comments will show user_data as null or limited information
  • All timestamps are in ISO 8601 format (e.g., "2023-01-01T12:00:00Z")