# 查询评价详情
接口应在服务器端调用,不可在前端(小程序、网页、APP等)直接调用,具体可参考接口调用指南。
接口英文名:getCommentInfo
查询某条评价的详细内容
# 1. 调用方式
# HTTPS 调用
GET https://api.weixin.qq.com/wxaapi/comment/commentinfo/get?access_token=ACCESS_TOKEN
# 云调用
- 本接口不支持云调用。
# 第三方调用
本接口支持第三方平台代商家调用。
该接口所属的权限集 id 为:151
服务商获得其中之一权限集授权后,可通过使用 authorizer_access_token 代商家进行调用,具体可查看 第三方调用 说明文档。
# 2. 请求参数
# 查询参数 Query String Parameters
| 参数名 | 类型 | 必填 | 示例 | 说明 |
|---|---|---|---|---|
| access_token | string | 是 | ACCESS_TOKEN | 接口调用凭证,可使用 access_token、authorizer_access_token |
# 请求体 Request Payload
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| commentId | string | 是 | 评价的 id |
# 3. 返回参数
# 返回体 Response Payload
| 参数名 | 类型 | 说明 |
|---|---|---|
| info | object | 评价的信息 |
| processInfo | object | 进度条的信息(只有差评才会有) |
| oldComment | object | 旧评价的信息(只有改评的新评价才有) |
# Res.info Object Payload
评价的信息
| 参数名 | 类型 | 说明 |
|---|---|---|
| content | object | 评价 |
# Res.processInfo Object Payload
进度条的信息(只有差评才会有)
| 参数名 | 类型 | 说明 |
|---|---|---|
| actionList | objarray | 进度的具体状态,数组类型,从数组最后往前数有updateTime的就是当前状态 |
| commentId | string | 评价进度对应的评价id |
# Res.oldComment Object Payload
旧评价的信息(只有改评的新评价才有)
| 参数名 | 类型 | 说明 |
|---|---|---|
| commentId | string | 评价id |
| createTime | string | 创建时间,单位是秒 |
| score | number | 用户评价的打分,每100对应1分以及1颗星 |
| content | object | 评论的内容 |
# Res.info.content Object Payload
评价
| 参数名 | 类型 | 说明 |
|---|---|---|
| commentId | string | 评价id |
| amount | string | 金额,单位是分 |
| orderId | string | 订单id |
| createTime | string | 创建时间,单位是秒 |
| payTime | string | 支付时间,单位是秒 |
| orderInfo | object | 商家订单信息 |
| productInfo | object | 评价商品信息 |
| wxPayId | string | 微信支付交易单号,一般以420开头,是微信支付接口文档中的transaction_id |
| userInfo | object | 评价用户信息 |
| bizInfo | object | 商家小程序信息 |
| score | string | 评价分数,每100分对应1星 |
| content | object | 评价内容 |
# Res.info.content.orderInfo Object Payload
商家订单信息
| 参数名 | 类型 | 说明 |
|---|---|---|
| busiOrderId | string | 商户单号:商户系统内部订单号,只能是数字、大小写字母_-*且在同一个商户号下唯一;是微信支付接口文档中的 out_trade_no |
# Res.info.content.productInfo Object Payload
评价商品信息
| 参数名 | 类型 | 说明 |
|---|---|---|
| productList | objarray | 商品列表 |
# Res.info.content.productInfo.productList(Array) Object Payload
商品列表
| 参数名 | 类型 | 说明 |
|---|---|---|
| name | string | 商品名 |
| picUrl | string | 商品图片 |
# Res.info.content.userInfo Object Payload
评价用户信息
| 参数名 | 类型 | 说明 |
|---|---|---|
| openid | string | 评价用户openid |
| headImg | string | 评价用户的头像 |
| nickName | string | 评价用户的昵称 |
# Res.info.content.bizInfo Object Payload
商家小程序信息
| 参数名 | 类型 | 说明 |
|---|---|---|
| appid | string | 商家小程序的appid |
| headImg | string | 商家小程序的头像 |
| nickName | string | 商家小程序的昵称 |
# Res.info.content.content Object Payload
评价内容
| 参数名 | 类型 | 说明 |
|---|---|---|
| media | objarray | 评价的媒体文件,如图片、视频 |
| txt | string | 评价内容 |
# Res.info.content.content.media(Array) Object Payload
评价的媒体文件,如图片、视频
| 参数名 | 类型 | 说明 |
|---|---|---|
| img | string | 图片cdn |
| thumbImg | string | 缩略图cdn |
| video | string | 视频资源cdn(有img的时候没有video) |
| videoCover | string | 缩略图cdn(有img的时候没有videoCover) |
| videoDuration | number | 视频时长,单位秒(有img的时候没有videoDuration) |
# Res.processInfo.actionList(Array) Object Payload
进度的具体状态,数组类型,从数组最后往前数有updateTime的就是当前状态
| 参数名 | 类型 | 说明 | 枚举 |
|---|---|---|---|
| type | number | 进度的类型 | 枚举值 |
| updateTime | number | 更新时间,processInfo.actionList里从后往前数第一个有更新时间的就是当前状态 | - |
# Res.oldComment.content Object Payload
评论的内容
| 参数名 | 类型 | 说明 |
|---|---|---|
| ext | string | 评价的文本内容 |
| media | objarray | 评价的多媒体内容,跟上面提到的媒体结构一致 |
# Res.oldComment.content.media(Array) Object Payload
评价的多媒体内容,跟上面提到的媒体结构一致
| 参数名 | 类型 | 说明 |
|---|---|---|
| img | string | 图片cdn |
| thumbImg | string | 缩略图cdn |
| video | string | 视频资源cdn(有img的时候没有video) |
| videoCover | string | 缩略图cdn(有img的时候没有videoCover) |
| videoDuration | number | 视频时长,单位秒(有img的时候没有videoDuration) |
# 4. 枚举信息
# Res.processInfo.actionList(Array).type Enum
进度的类型
| 枚举值 | 描述 |
|---|---|
| 1 | 发表差评 |
| 2 | 开发者处理 |
| 3 | 用户调研 |
| 4 | 用户改评 |
# 5. 注意事项
本接口无特殊注意事项
# 6. 代码示例
请求示例
GET https://api.weixin.qq.com/wxaapi/comment/commentinfo/get?commentId=123456&access_token=xxxxxx
返回示例
{
info: {
content: {
commentId: '123',
createTime: '1669031402',
userInfo: { openid: 'xxx', headImg: '', nickName: '啊哈' },
content: {
txt: '突突突突突突有',
media: [
{
video:
'https://xxx/xx',
videoCover: 'http://xxx/xx',
videoDuration: 11
}
]
},
bizInfo: {
appid: "wx1234567890",
headImg: "http://wx.qlogo.cn/mmhead/xxxxxx",
nickName: "xxx的小商店"
},
score: 200, // 评价分数、星级,这里200分对应2星
orderId: 'payorder@xxxx',
wxPayId: 'xxxx',
orderInfo: {
busiOrderId: 'xxxxxx'
},
productInfo: {
productList: [{
name: "我是描述",
picUrl: "https://xxxxx/x"
}]
},
payTime: '1669030760',
amount: 1,
}
},
processInfo: { // 订单处理进度数据
commentId: 'xxx',
actionList: [
{
type: 1,
updateTime: 1669031402,
},
{ type: 2 },
{ type: 3 }
]
},
oldComment: {
commentId: 'xxx',
content: {},
score: 100,
createTime: 11111
},
}
# 7. 错误码
以下是本接口的错误码列表,其他错误码可参考 通用错误码;调用接口遇到报错,可使用官方提供的 API 诊断工具 辅助定位和分析问题。
| 错误码 | 错误描述 |
|---|---|
| -10403 | 无权限操作该评价/评论/回复 |
| -10008 | 服务异常 |
| -10007 | 无权限调用接口 |
| -10003 | 参数不匹配 |
| -10001 | 参数异常 |
| 10000 | 和解:不是差评/发送过模板消息;其它:参数异常 |
# 8. 适用范围
本接口支持「小程序」账号类型调用。其他账号类型如无特殊说明,均不可调用。