Get product or order evaluation list, supports filtering and pagination by product, user, and other conditions.
Precautions
- This interface uses the GET method
- Supports filtering by product ID, user ID, order ID, etc.
- Supports custom sorting methods
- Supports pagination, with 10 records per page by default
- Only return evaluated comments that have been approved (status is 1)
Request address
{域名地址}/api/review/list
Description:{域名地址}Need to replace it with your domain address, such ashttps://en.anqicms.com/api/review/list
Request syntax
GET {域名地址}/api/review/list
Request header
This interface also involves common request headers. For more information, please seeCommon Request Headers (Common Request Headers).
Request Parameters
| Field Name | Type | Required | Description |
|---|---|---|---|
| id | integer | No | Document ID, specify the product to retrieve comments for |
| user_id | integer | No | User ID, retrieve comments for the specified user |
| order | string | No | Comment sorting method, defaultid desc |
| page | integer | No | Page number, default is 1 |
| limit | integer | No | Number of items per page, default is 10 |
Response Headers
This interface only involves public response headers. More information, please refer toCommon Request Headers (Common Request Headers).
Return parameters
| Field Name | Type | Description |
|---|---|---|
| code | integer | Error code |
| message | string | Error Description |
| data | object[] | Rating list array |
data result item parameter
| Field Name | Type | Description |
|---|---|---|
| id | integer | Comment ID |
| order_id | string | Order ID |
| archive_id | integer | Document ID |
| archive_sku_id | integer | SKU ID |
| user_id | integer | User ID |
| IP | string | User IP address |
| score | integer | Rating (1-5 points) |
| content | string | Review content |
| images | string array | Review image list |
| user_name | string | Username |
| string | User email | |
| created_time | integer | Publish timestamp |
| updated_time | integer | update timestamp |
| status | integer | Review status, 1 Reviewed, 0 Reviewing |
Example Usage
Request Example
GET /api/review/list?archive_id=1&page=1&limit=10 HTTP/1.1
Host: www.anqicms.com
Response Example
{
"code": 0,
"msg": "获取成功",
"data": [
{
"id": 45,
"order_id": "20231101000001",
"archive_id": 1,
"archive_sku_id": 1,
"user_id": 123,
"ip": "192.168.1.100",
"score": 5,
"content": "商品质量很好,非常满意!",
"images": [
"https://en.anqicms.com/uploads/review/2023/11/image1.jpg",
"https://en.anqicms.com/uploads/review/2023/11/image2.jpg"
],
"user_name": "张三",
"email": "[email protected]",
"created_time": 1698825600,
"updated_time": 1698825600,
"status": 1
},
{
"id": 44,
"order_id": "20231031000005",
"archive_id": 1,
"archive_sku_id": 2,
"user_id": 124,
"ip": "192.168.1.101",
"score": 4,
"content": "商品不错,物流也很快。",
"images": [],
"user_name": "李四",
"email": "[email protected]",
"created_time": 1698739200,
"updated_time": 1698739200,
"status": 1
}
]
}
Error Code
| Error code | Description |
|---|---|
| 0 | OK |
| -1 | Error, the reason is indicated in msg |
| 1001 | Not logged in |
| 1002 | Unauthorized |
| 200 | API request OK |