HomeGuidesAPI ReferenceChangelogDiscussions
HomeLog In
Guides

Get Product Review Comments

Function

To retrieve product review comments.
抓取商品評價。

URL

GET <<api_domain>>/v1/product_review_comments

Request parameters

ParameterTypeDescriptionExample
product_idStringProduct id
產品id
product_id=5f72f7e4e388092cfc6a67f7
pageIntegerPage Number
頁數
(Default: 1)
page=1
per_pageIntegerNumbers of items per Page
每頁顯示 n 筆資料
(Default: 24)
per_page=24
sort_byStringSorting by field
以欄位排序
(Default: created_at)
-
created_at: 創建時間
rating: 評分
sort_by=created_by
order_byStringSetting sort by created time
設定排序
(Default: desc)
-
asc: asending 升冪
desc: descending 降冪
order_by=desc
statusStringStatusstatus=active

Response Fields

FieldTypeDescriptionExample
itemsGet Product Review CommentProduct review comment information
產品評價資訊
Please check the link on the left
paginationPaginationPagination
頁面資訊
Please check the link on the left

Response Example

{
    "items": [
        {
            "id": "5f6d742ce38809bd9fcc438b",
            "product_id": "5f57251ce38809bde9681c3b",
            "order_id": "5f686623e38809c8ed14b1ea",
            "user_id": "5f602e9c01afcd34f53db613",
            "user_name": "Ming",
            "status": "hidden",
            "score": 1,
            "comment": "Hello",
            "media": [],
            "created_by": "importer",
            "commented_at": "2020-09-25T04:38:04.203+00:00",
            "updated_at": "2020-09-25T04:38:04.203+00:00",
            "created_at": "2020-09-25T04:38:04.203+00:00"
        },
        {
            "id": "5f6d741ae38809bd9fcc438a",
            "product_id": "5f57251ce38809bde9681c3b",
            "order_id": "5f686623e38809c8ed14b1ea",
            "user_id": "5f602e9c01afcd34f53db613",
            "user_name": "Ming",
            "status": "hidden",
            "score": 1,
            "comment": "Hello",
            "media": [],
            "created_by": "importer",
            "commented_at": "2020-09-25T04:37:46.258+00:00",
            "updated_at": "2020-09-25T04:37:46.257+00:00",
            "created_at": "2020-09-25T04:37:46.257+00:00"
        },
        {
            "id": "5f6d73d2e38809bd9fcc4389",
            "product_id": "5f57251ce38809bde9681c3b",
            "order_id": "5f686623e38809c8ed14b1ea",
            "user_id": null,
            "user_name": null,
            "status": "hidden",
            "score": 1,
            "comment": "Hello",
            "media": [],
            "created_by": "importer",
            "commented_at": "2020-09-25T04:36:34.610+00:00",
            "updated_at": "2020-09-25T04:36:34.610+00:00",
            "created_at": "2020-09-25T04:36:34.610+00:00"
        },
        {
            "id": "5f6d72a3e38809bd9fcc4387",
            "product_id": "5f6b18d6e388092cfc6a6766",
            "order_id": null,
            "user_id": null,
            "user_name": null,
            "status": "hidden",
            "score": 3,
            "comment": "Hello",
            "media": [],
            "created_by": "importer",
            "commented_at": "2020-09-25T04:31:31.322+00:00",
            "updated_at": "2020-09-25T04:31:31.322+00:00",
            "created_at": "2020-09-25T04:31:31.322+00:00"
        },
        {
            "id": "5f6d722fe38809bd9fcc4384",
            "product_id": "5f6b18d6e388092cfc6a6766",
            "order_id": null,
            "user_id": null,
            "user_name": null,
            "status": "hidden",
            "score": 3,
            "comment": "Hello",
            "media": [],
            "created_by": "importer",
            "commented_at": "2020-09-25T04:29:35.235+00:00",
            "updated_at": "2020-09-25T04:29:35.235+00:00",
            "created_at": "2020-09-25T04:29:35.235+00:00"
        }
    ],
    "pagination": {
        "current_page": 1,
        "per_page": 24,
        "total_count": 5,
        "total_pages": 1
    }
}

Note

如果不設定「sort_by」,抓到的資料排序會依據:
comment時間 新到舊
分數 高到低