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.
Note: The operation is scoped to a specific shop, identified by its unique domain prefix (shopdomain
), ensuring all updates are applied to the correct store.
Public Request Parameters
Parameter Name | Type | Required | Parameter Location | Parameter Value | Description |
---|---|---|---|---|---|
Access-Token | String | Yes | Header | Bx-_5aV eXNwl-4AB98s5xLV yg0fNzGf MuTpqtlBA | Used to authenticate API requests. Obtain an access token from the Access Token Guide. Pass it in the Authorization header for every request. |
Content-Type | String | Yes | Header | application /json | Indicates the media type of the request body. It tells the server how to parse the request and the client how to interpret the response. For more details, visit Content-Type. |
Public Response Parameters
Parameter Name | Type | Mandatory | Parameter Location | Example Value | Description |
---|---|---|---|---|---|
error | String | No | Response Body | { "error": "store is not active" } | Indicates an error encountered during the process. This field typically appears when the Access Token is missing or invalid. Example: { "error": "store is not active" } . |
errors | Array | No | Response Body | { "errors"["ProductId is required"] } | A list of errors that occurred during the request processing. Example: { "errors": [ "No Context" ] } . |
Request-Id | String | Yes | Header | Bx-_5aV eXNwl-4AB98s5xLV yg0fNzGf MuTpqtlBA | A unique identifier for each request. It helps in identifying and debugging specific requests. |
Error and Errors Clarification:
Added explanation that the error and errors fields are currently dependent on the API implementation, with plans for future unification.
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
Successful 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 | ["0048955f731656d0e7fc8b5e03509ed7.webp?width=650&height=433"] | Array of image URLs associated with the comment. |
comments.status | string | 1 | Status of the comment 1: published, 0: unpublished |
comments.type | string | 1 | Type of the comment - 1 : Buyer's real comments- 2 : Custom comments |
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 (1 for featured, 0 otherwise). |
comments.is_verified | string | 0 | Indicates if the comment is verified (1 for verified, 0 otherwise). |
comments.client_id | null | null | Client identifier if available. |
comments.anonymous | string | 0 | Indicates if the comment is anonymous (1 for anonymous, 0 otherwise). |
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. |
Request Examples
curl --request GET \
--url https://{shopdomain}.myshoplaza.com/openapi/2022-01/comments/list \
--header 'accept: application/json' \
--header 'access-token: YOUR_ACCESS_TOKEN' \
--header 'content-type: application/json' \
--data '{
"product_id": "a1b2c3d4-e5f6-7g8h-9i0j",
"created_at_min": "2018-10-01T16:15:47-04:00",
"page": 1,
"limit": 10
}'
Success Response Example
{
"comments": [
{
"id": "23532434",
"store_id": "633130",
"username": "Joey",
"email": "",
"star": "5.0",
"like": "10",
"content": "Cheap but beautiful",
"img": "[\"0048955f731656d0e7fc8b5e03509ed7.webp?width=650&height=433\"]",
"status": "1",
"type": "1",
"product_id": "a1a88be0-a1d4-47e4-a2f2-ba6e131cf447",
"created_at": "2024-04-24 14:02:39",
"updated_at": "2024-04-25 08:22:59",
"country": "CN",
"is_featured": "0",
"is_verified": "0",
"client_id": null,
"anonymous": "0"
}
],
"total": "6",
"page": "1"
}
Error Response Example
{
"errors": [
"params is invalid"
]
}
{
"error": "store is not active"
}
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"]} |