Requires
read_comment
access scope. For more access scope
The Get Comment List API retrieves a list of comments for a specific product or across multiple products, based on various filters. This API allows users to sort, filter, and paginate the comments, making it easier to manage product reviews and feedback.This API is especially useful for:
1.Fetching customer reviews for a product.
2.Filtering comments by creation or update time for analytics.
3.Managing comment status, such as published or unpublished.
Request Parameters
Public Request Parameters
Query Parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
product_id | string | No | a1b2c3d4-e5f6-7g8h-9i0j | Product's ID to filter comments. |
created_at_min | string | No | 2018-10-01T16:15:47-04:00 | Filters comments created at or after this date. Format: YYYY-MM-DDTHH:mm:ssZ . |
created_at_max | string | No | 2018-10-02T16:15:47-04:00 | Filters comments created at or before this date. Format: YYYY-MM-DDTHH:mm:ssZ . |
updated_at_min | string | No | 2018-10-01T16:15:47-04:00 | Filters comments updated at or after this date. Format: YYYY-MM-DDTHH:mm:ssZ . |
updated_at_max | string | No | 2018-10-02T16:15:47-04:00 | Filters comments updated at or before this date. Format: YYYY-MM-DDTHH:mm:ssZ . |
sort_by | string | No | star | Specify the sort field. e.g.star or created_at |
sort_direction | string | No | asc | Specify the sort direction. asc or desc |
page | int32 | No | 1 | Page number. Defaults to 1 . |
limit | int32 | No | 10 | Limit per page. Allowed values: 10 , 20 , 50 , 100 . |
status | string | No | 1 | Comment status. 1 for published, 0 for unpublished. |
Response Explanation
Public Response Parameters
Success Response
Field | Type | Example | Description |
---|---|---|---|
comments |
array | - | List of comments returned. |
comments.id |
string | 23532434 |
Unique identifier of the comment. |
comments.store_id |
string | 633130 |
Identifier for the store associated with the comment. |
comments.username |
string | Joey |
Username of the commenter. |
comments.email |
string | "" |
Email address of the commenter (if available). |
comments.star |
string | 5.0 |
Star rating given by the commenter. |
comments.like |
string | 10 |
Number of likes received by the comment. |
comments.content |
string | Cheap but beautiful |
Content of the comment. |
comments.img |
string | ["image1.jpg", "image2.jpg"] |
Array of image URLs associated with the comment. |
comments.status |
string | 1 |
Status of the comment: 1 for published, 0 for unpublished. |
comments.type |
string | 1 |
Type of the comment:
|
comments.product_id |
string | a1a88be0-a1d4-47e4-a2f2-ba6e131cf447 |
UUID of the product the comment is associated with. |
comments.created_at |
string | 2024-04-24 14:02:39 |
Timestamp when the comment was created. |
comments.updated_at |
string | 2024-04-25 08:22:59 |
Timestamp when the comment was last updated. |
comments.country |
string | CN |
Country code of the commenter. |
comments.is_featured |
string | 0 |
Indicates if the comment is featured:
|
comments.is_verified |
string | 0 |
Indicates if the comment is verified:
|
comments.client_id |
null | null |
Client identifier if available. |
comments.anonymous |
string | 0 |
Indicates if the comment is anonymous:
|
total |
string | 6 |
Total number of comments available for the given filters. |
page |
string | 1 |
Current page of the comments being returned. |
Error Response
Error responses in the API can be represented using two different fields: errors
and error
. Both fields provide details about issues encountered during request processing. Below is an explanation of the fields with their respective examples and descriptions.
Field | Type | Example | Description |
---|---|---|---|
errors | Array | [ "params is invalid"] | A list of errors encountered during the request processing. |
Field | Type | Example | Description |
---|---|---|---|
error | Array | "store is not active" | Indicates an error encountered during the process. |
Error Details
Status Code | Message | Possible Reason | Example Response |
---|---|---|---|
400 | Bad Request | Invalid input format or request structure (e.g., missing required fields or incorrect data types). | Bad Request |
Unauthorized | The request is missing valid authentication credentials or the credentials provided are invalid. | Unauthorized | |
404 | Invalid or empty store name | invalid store name | { "errors": store is not active} |
422 | params is invalid | The params provided are not correct, please check the field such as like ,star ,name and content | { "errors": ["params is invalid"]} |