Get Comment List

🔒

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 NameTypeRequiredParameter LocationParameter ValueDescription
Access-TokenStringYesHeaderBx-_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-TypeStringYesHeaderapplication
/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 NameTypeMandatoryParameter LocationExample ValueDescription
errorStringNoResponse 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" }.
errorsArrayNoResponse Body{ "errors"["ProductId is required"] }A list of errors that occurred during the request processing. Example: { "errors": [ "No Context" ] }.
Request-IdStringYesHeaderBx-_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

ParameterTypeRequiredExampleDescription
product_idstringNoa1b2c3d4-e5f6-7g8h-9i0jProduct's ID to filter comments.
created_at_minstringNo2018-10-01T16:15:47-04:00Filters comments created at or after this date. Format: YYYY-MM-DDTHH:mm:ssZ.
created_at_maxstringNo2018-10-02T16:15:47-04:00Filters comments created at or before this date. Format: YYYY-MM-DDTHH:mm:ssZ.
updated_at_minstringNo2018-10-01T16:15:47-04:00Filters comments updated at or after this date. Format: YYYY-MM-DDTHH:mm:ssZ.
updated_at_maxstringNo2018-10-02T16:15:47-04:00Filters comments updated at or before this date. Format: YYYY-MM-DDTHH:mm:ssZ.
sort_bystringNostarSpecify the sort field. e.g.star or created_at
sort_directionstringNoascSpecify the sort direction. asc or desc
pageint32No1Page number. Defaults to 1.
limitint32No10Limit per page. Allowed values: 10, 20, 50, 100.
statusstringNo1Comment status. 1 for published, 0 for unpublished.

Response Explanation

Successful Response

FieldTypeExampleDescription
commentsarray-List of comments returned.
comments.idstring23532434Unique identifier of the comment.
comments.store_idstring633130Identifier for the store associated with the comment.
comments.usernamestringJoeyUsername of the commenter.
comments.emailstring""Email address of the commenter (if available).
comments.starstring5.0Star rating given by the commenter.
comments.likestring10Number of likes received by the comment.
comments.contentstringCheap but beautifulContent of the comment.
comments.imgstring["0048955f731656d0e7fc8b5e03509ed7.webp?width=650&height=433"]Array of image URLs associated with the comment.
comments.statusstring1Status of the comment 1: published, 0: unpublished
comments.typestring1Type of the comment
-1: Buyer's real comments
-2: Custom comments
comments.product_idstringa1a88be0-a1d4-47e4-a2f2-ba6e131cf447UUID of the product the comment is associated with.
comments.created_atstring2024-04-24 14:02:39Timestamp when the comment was created.
comments.updated_atstring2024-04-25 08:22:59Timestamp when the comment was last updated.
comments.countrystringCNCountry code of the commenter.
comments.is_featuredstring0Indicates if the comment is featured (1 for featured, 0 otherwise).
comments.is_verifiedstring0Indicates if the comment is verified (1 for verified, 0 otherwise).
comments.client_idnullnullClient identifier if available.
comments.anonymousstring0Indicates if the comment is anonymous (1 for anonymous, 0 otherwise).
totalstring6Total number of comments available for the given filters.
pagestring1Current 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.

FieldTypeExampleDescription
errorsArray[ "params is invalid"]A list of errors encountered during the request processing.
FieldTypeExampleDescription
errorArray "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 CodeMessagePossible ReasonExample Response
400Bad RequestInvalid input format or request structure (e.g., missing required fields or incorrect data types).Bad Request
UnauthorizedThe request is missing valid authentication credentials or the credentials provided are invalid.Unauthorized
404Invalid or empty store nameinvalid store name{ "errors": store is not active}
422params is invalidThe params provided are not correct, please check the field such as like,star,name and content{ "errors": ["params is invalid"]}
Language
Credentials
Header
URL
Click Try It! to start a request and see the response here!