The Discussions API allows you to manage reviews and comments in your store. This guide provides examples for each endpoint with sample requests and responses.
https://www.venddor.com.br/api/2.0
Retrieves a list of reviews and comments with their properties.
curl -X GET 'https://www.venddor.com.br/api/2.0/discussions/'
Retrieves details of a specific review or comment by its ID.
| Parameter | Type | Description |
|---|---|---|
| id* | integer | The unique identifier of the review or comment |
curl -X GET 'https://www.venddor.com.br/api/2.0/discussions/18'
post_id=18.
Creates a new review or comment in the system.
Required fields: object_type + object_id or thread_id
Available fields: object_type, object_id, thread_id, name, message, rating_value, timestamp, status
| Status Code | Description |
|---|---|
201 Created |
Review or comment created successfully |
400 Bad Request |
Invalid request parameters |
curl -H "Content-Type: application/json" -X POST https://www.venddor.com.br/api/2.0/discussions -d '{"object_type":"P", "object_id":242, "name":"John Doe", "rating_value":4, "message":"Hi, I use the API!"}'
This example creates a product review from John Doe for the product with product_id=242. The rating is 4 out of 5 stars, and the message is "Hi, I use the API!".
{
"post_id": 22
}
Updates an existing review or comment with new properties.
| Parameter | Type | Description |
|---|---|---|
| id* | integer | The unique identifier of the review or comment to update |
name, message, rating_value, timestamp, status
curl -H "Content-Type: application/json" -X PUT https://www.venddor.com.br/api/2.0/discussions/22 -d '{"rating_value":5, "message":"Changed message via API", "status":"D"}'
This example updates the review or comment with post_id=22. It changes the rating_value to 5, modifies the message to "Changed message via API", and sets the status to disapproved.
{
"post_id": 22
}
Deletes a specific review or comment from the system.
| Parameter | Type | Description |
|---|---|---|
| id* | integer | The unique identifier of the review or comment to delete |
| Status Code | Description |
|---|---|
204 No Content |
Review or comment deleted successfully |
400 Bad Request |
Review or comment couldn't be deleted |
404 Not Found |
Review or comment doesn't exist |
curl -X DELETE 'https://www.venddor.com.br/api/2.0/discussions/22'
This example deletes the review or comment with post_id=22.
disapproved instead of deleting if you want to hide it from customers.