Version: 202201
Batch Create Comment
POST/openapi/2022-01/comments/batch
Allows users to create multiple comments for products in a single request.
Request
- application/json
- Body
- Example
Body
- Array [
- ]
comments object[]
product_idstring
Product's ID
usernamestringrequired
User name, for example: Joey
starint32required
Start count: 1 ~ 5
imagestring
Images in comment, separate by semicolon, for example: http://abc.com/img.jpg; http://def.com/img.jpg
likeint32required
Like count, for example: 100
created_atstringrequired
Comment created time, for example: 2019-07-10 15:00:00
contentstringrequired
Comment content, for example: Cheap but beautiful
countrystring
Country code where this comment is created from, for example: CN
{
"comments": [
{
"product_id": "string",
"username": "string",
"star": 0,
"image": "string",
"like": 0,
"created_at": "string",
"content": "string",
"country": "string"
}
]
}
Responses
- 200
200
- application/json
- Schema
- Example
- Result
Schema
- Array [
- ]
success_countinteger
Default value:
0Example:
0error_countinteger
Default value:
0Example:
1error_info object[]
product_idstring
Example:
33f1b4f6-9474-4e6c-9a3f-676a420ea8bbusernamestring
Example:
123starinteger
Default value:
0Example:
1imagestring[]
likeinteger
Default value:
0Example:
1created_atstring
Example:
2contentstring
Example:
123countrystring
Example:
23error_messagestring
Example:
评论时间格式错误;product_publishedinteger
Default value:
0Example:
1{
"success_count": 0,
"error_count": 1,
"error_info": [
{
"product_id": "33f1b4f6-9474-4e6c-9a3f-676a420ea8bb",
"username": "123",
"star": 1,
"image": [
"123"
],
"like": 1,
"created_at": "2",
"content": "123",
"country": "23",
"error_message": "评论时间格式错误;",
"product_published": 1
}
]
}
{
"success_count": 0,
"error_count": 1,
"error_info": [
{
"product_id": "33f1b4f6-9474-4e6c-9a3f-676a420ea8bb",
"username": "123",
"star": 1,
"image": [
"123"
],
"like": 1,
"created_at": "2",
"content": "123",
"country": "23",
"error_message": "评论时间格式错误;",
"product_published": 1
}
]
}