商品评论-创建
Product Review Add Review API 文档
接口信息
- 接口地址:
{your-site-url}/api/skill/product-review/add-review
- 基础 URL:
{your-site-url} 需替换为你自己的独立站 URL 地址,如 https://your-domain.com/apimanager666
- 请求方式:
POST
- Content-Type:
application/json
- 说明: 此接口用于为指定商品添加评论
认证
请求头中需要携带 skill-access-token:
| Header |
值 |
skill-access-token |
{your-skill-access-token} (请替换为你自己的 token) |
请求参数 (JSON Body)
| 字段 |
类型 |
必填 |
说明 |
product_id |
string |
✅ 必填 |
商品 ID |
review_content |
string |
✅ 必填 |
评论内容 |
star |
int |
✅ 必填 |
评星,取值范围 1~5 |
images |
Array[Object] |
选填 |
评论图片数组,每个元素为对象。详见下方 images 子项字段说明。图片需先调用 图片-上传图片 上传获取 src 路径 |
person_name |
string |
✅ 必填 |
评论人名称 |
likes_count |
int |
选填 |
点赞数 |
reviewed_at |
string |
选填 |
评论时间,格式如 2026-05-21 10:30:00 |
verified_purchase |
int |
选填 |
是否显示 Verified Purchase 标志。1 = 显示,2 = 不显示 |
status |
int |
选填 |
发布状态。1 = 发布(默认),2 = 不发布。不填写默认为 1 |
email |
string |
选填 |
评论人邮箱 |
reply_content |
string |
选填 |
回复内容 |
replyed_at |
string |
选填 |
回复时间,格式如 2026-05-22 10:30:00 |
language_code |
string |
选填 |
语言简码,如 en、cn |
is_feature |
int |
选填 |
是否精选评论。1 = 精选,2 = 普通评论(默认)。不填写默认为 2 |
请求示例
cURL
curl --location --request POST '{your-site-url}/api/skill/product-review/add-review' \
--header 'skill-access-token: {your-skill-access-token}' \
--header 'Content-Type: application/json' \
--data-raw '{
"product_id": "7046",
"review_content": "This product exceeded my expectations! Great quality and fast shipping.",
"star": 5,
"images": [
{
"src": "/customer_upload/15/image/2026/05/26/d415117a015cf7cf85f38fe6f62e81d4.png",
"width": 123,
"height": 120,
"ratio": 1.03
},
{
"src": "/customer_upload/15/image/2026/05/26/6da29c9b10bd1b4d5c299e2e80845bbe.png",
"width": 1008,
"height": 870,
"ratio": 1.16
}
],
"person_name": "John Doe",
"likes_count": 42,
"verified_purchase": 1,
"reviewed_at": "2026-05-21 10:30:00",
"status": 1,
"email": "fecify@126.com",
"reply_content": "reply xxxxx",
"replyed_at": "2026-05-22 10:30:00",
"is_feature": 1,
"language_code": "en"
}'
返回结果
code 为 200 表示调用成功;code 不为 200 表示调用失败。
images 子项字段
| 字段 |
类型 |
必填 |
说明 |
src |
string |
✅ 必填 |
图片路径。需先调用 图片-上传图片 上传图片获取 |
width |
int |
选填 |
图片宽度(px) |
height |
int |
选填 |
图片高度(px) |
ratio |
float |
选填 |
图片宽高比 |
成功响应
{
"code": 200,
"data": [],
"message": "success"
}
返回字段说明
| 字段 |
类型 |
说明 |
code |
Number |
状态码,200 表示成功 |
message |
String |
执行结果的文字描述 |
data |
Array |
返回数据,目前为空数组 |
注意事项
product_id、review_content、star 为必填
star 取值范围 1~5
images 为图片对象数组,每个对象中 src 必填,width、height、ratio 为选填。src 需先调用 图片-上传图片 上传图片获取路径