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 with ProductCommentPermission or Admin
  • Permission Code: 1882
  • 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())

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
titlestringTitle of the product

Example Response

{
"id": 1,
"rating": 3,
"content": "واقعا ماوس خوبی است",
"is_anonymous": false,
"is_published": false,
"created_at": "2025-11-22T15:24:49.833816Z",
"updated_at": "2025-11-22T15:24:49.833821Z",
"user_data": {
"id": 2,
"username": "staffer",
"full_name": "عماد رخشانی",
"avatar": "http://127.0.0.1:8000/media/users/avatars/Fantasticheskie_kartinki_dlja_monitora_68_76.jpg"
},
"product_data": {
"id": 36,
"title": "ماوس لاجیتک MX Vertical"
},
"truncated_content": "واقعا ماوس خوبی است"
}