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
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | integer | Yes | Unique ID of the product comment |
Example Requests
- 🐍 Python
- 🌐 Curl
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())1curl "http://www.example.com/api/products/comments/123" -H "Authorization: Token <your_api_key>"Response Fields
| Field | Type | Description |
|---|---|---|
| id | integer | Unique ID of the comment |
| rating | integer | Rating given (1-5: Worst, Bad, Average, Good, Best) |
| content | string | Comment content (max 500 characters) |
| is_anonymous | boolean | Whether the comment is posted anonymously |
| is_published | boolean | Whether the comment is published |
| user_data | object | User details (read-only) |
| product_data | object | Product details (read-only) |
| truncated_content | string | Shortened version of content |
| created_at | string (ISO 8601) | Timestamp when comment was created |
| updated_at | string (ISO 8601) | Timestamp when comment was last updated |
User Data Structure
| Field | Type | Description |
|---|---|---|
| id | integer | Unique ID of the user |
| username | string | Username of the user |
| full_name | string | Full name of the user |
| avatar | string | URL of the user avatar image |
Product Data Structure
| Field | Type | Description |
|---|---|---|
| id | integer | Unique ID of the product |
| title | string | Title 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": "واقعا ماوس خوبی است"
}