Delete Product Comment
Deletes an existing product comment.
HTTP Request
DELETE/api/products/comments/:id
Authorization
Authorization
- Required: Yes
- Permission: Staff or Admin
- Authentication: Token-based (Authorization: Token <your_api_key>)
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | integer | Yes | Unique ID of the product comment to delete |
Example Requests
- 🐍 Python
- 🌐 Curl
1import requests
2
3response = requests.delete('http://www.example.com/api/products/comments/123',
4 headers={'Authorization': 'Token <your_api_key>'}
5)
6print(response.status_code) # Should be 204 for successful deletion1curl -X DELETE "http://www.example.com/api/products/comments/123" -H "Authorization: Token <your_api_key>"Status Codes
| Code | Description |
|---|---|
| 204 | Product comment deleted successfully |
| 401 | Unauthorized — authentication required |
| 403 | Forbidden — insufficient permissions |
| 404 | Product comment not found |
| 500 | Internal server error |
Response Fields
| Field | Type | Description |
|---|---|---|
| No Content | empty | No content returned on successful deletion |
Notes
- Successfully deleting a comment returns a 204 No Content status with no response body
- Deleting a comment will affect the overall product rating calculation
- This action is permanent and cannot be undone