Skip to main content

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

ParameterTypeRequiredDescription
idintegerYesUnique ID of the product comment to delete

Example Requests

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 deletion

Status Codes

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

Response Fields

FieldTypeDescription
No ContentemptyNo 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