# 查询评价列表
接口应在服务器端调用,不可在前端(小程序、网页、APP等)直接调用,具体可参考接口调用指南。
接口英文名:getCcommentList
查询某小程序下面所有的评价。
# 1. 调用方式
# HTTPS 调用
GET https://api.weixin.qq.com/wxaapi/comment/mpcommentlist/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
| 参数名 | 类型 | 必填 | 说明 | 枚举 |
|---|---|---|---|---|
| startTime | string | 是 | 查询时间段的开始时间 | - |
| endTime | string | 是 | 查询时间段的结束时间 | - |
| filterType | number | 否 | 过滤的数据类型 | 枚举值 |
| offset | number | 否 | 查询的偏移数(从offset开始计数拉取),默认值为 0 代表首页拉取 | - |
| limit | number | 否 | 查询每页中的数量,默认值为 8 | - |
# 3. 返回参数
# 返回体 Response Payload
| 参数名 | 类型 | 说明 |
|---|---|---|
| errcode | string | 错误码 |
| offset | number | 查询的偏移数(从offset开始计数拉取) |
| total | number | 评价总数 |
| commentList | objarray | 评价的列表 |
# Res.commentList(Array) Object Payload
评价的列表
| 参数名 | 类型 | 说明 |
|---|---|---|
| commentId | string | 评价id |
| amount | number | 金额,单位是分 |
| orderId | string | 订单id |
| createTime | string | 创建时间,单位是秒 |
| payTime | string | 支付时间,单位是秒 |
| wxPayId | string | 微信支付交易单号,一般以420开头,是微信支付接口文档中的transaction_id |
| orderInfo | object | 商家订单信息 |
| userInfo | object | 评价用户信息 |
| bizInfo | object | 商家小程序信息 |
| score | number | 评价分数(每100分对应1星) |
| content | object | 评价内容 |
| extInfo | object | 评价额外信息 |
| productInfo | object | 评价商品信息 |
# Res.commentList(Array).orderInfo Object Payload
商家订单信息
| 参数名 | 类型 | 说明 |
|---|---|---|
| busiOrderId | string | 商户单号:商户系统内部订单号,只能是数字、大小写字母_-*且在同一个商户号下唯一;是微信支付接口文档中的 out_trade_no |
# Res.commentList(Array).userInfo Object Payload
评价用户信息
| 参数名 | 类型 | 说明 |
|---|---|---|
| openid | string | 评价用户openid |
| headImg | string | 评价用户的头像 |
| nickName | string | 评价用户的昵称 |
# Res.commentList(Array).bizInfo Object Payload
商家小程序信息
| 参数名 | 类型 | 说明 |
|---|---|---|
| appid | string | 商家小程序的appid |
| headImg | string | 商家小程序的头像 |
| nickName | string | 商家小程序的昵称 |
# Res.commentList(Array).content Object Payload
评价内容
| 参数名 | 类型 | 说明 |
|---|---|---|
| txt | string | 评价内容 |
| media | objarray | 评价的媒体文件,如图片、视频, 视频跟图片只能存在一种,不同时存在,如果是图片可以有多张图,如果是视频只会有一个视频 |
# Res.commentList(Array).content.mediaObject Payload
Object Payload评价的媒体文件,如图片、视频, 视频跟图片只能存在一种,不同时存在,如果是图片可以有多张图,如果是视频只会有一个视频
| 参数名 | 类型 | 说明 |
|---|---|---|
| img | string | 图片cdn |
| thumbImg | string | 缩略图cdn |
| video | string | 视频资源cdn(有img的时候没有video) |
| videoCover | string | 缩略图cdn(有img的时候没有videoCover) |
| videoDuration | number | 视频时长,单位秒(有img的时候没有videoDuration) |
# Res.commentList(Array).extInfo Object Payload
评价额外信息
| 参数名 | 类型 | 说明 |
|---|---|---|
| isAlreadySendTmpl | boolean | 是否已发过「差评客服会话」 |
# Res.commentList(Array).productInfo Object Payload
评价商品信息
| 参数名 | 类型 | 说明 |
|---|---|---|
| productList | objarray | 商品列表 |
# Res.commentList(Array).productInfo.productListObject Payload
Object Payload商品列表
| 参数名 | 类型 | 说明 |
|---|---|---|
| name | string | 商品名 |
| picUrl | string | 商品图片 |
# 4. 枚举信息
# Body.filterType Enum
过滤的数据类型
| 枚举值 | 描述 |
|---|---|
| 1 | 全部差评,所有评价分数为1星、2星的评价 |
| 2 | 全部好评,所有评价分数为4星、5星的评价 |
| 3 | 差评待处理,所有未提交「和解挽回」的评价 |
| 4 | 开发者待回复,所有待开发者回复的评价 |
| 5 | 差评已改评 |
| 6 | 全部评价,所有好评、差评、中评(3星)部评价 |
# 5. 注意事项
本接口无特殊注意事项
# 6. 代码示例
请求示例
GET https://api.weixin.qq.com/wxaapi/comment/mpcommentlist/get?filterType=1&offset=0&limit=8&startTime=1588237130&endTime=1588237131&access_token=xxxx
返回示例
{
errcode: 0,
success: true,
commentList: [{
commentId: "2797755680173111111",
amount: 100,
orderId: "payorder@_4200001761202302096311111111",
payTime: "1675915718",
wxPayId: "4200001761202302096311111111",
orderInfo: {
busiOrderId: 'xxxxxx'
},
userInfo: {
openid: "xxxxxxxxxx",
headImg: "http://wx.qlogo.cn/mmhead/xxxxxxxxxxx",
nickName: "test"
},
bizInfo: {
appid: "wx1234567890",
headImg: "http://wx.qlogo.cn/mmhead/xxxxxxxxxxxx",
nickName: "xxx"
},
score: 200, // 200分对应2星,每100分就是1星
createTime: "1676351504",
content: {
media: [{img: 'http://xxx', thumbImg: 'http://xxx'}],
txt: "一般吧 我总感觉这个成分很伤皮肤,用了之后一直很干燥,不是很喜欢这款产品"
},
extInfo: {
isAlreadySendTmpl: false,
},
productInfo: {
productList: [
{
name: "纸巾一张",
picUrl: "https://xxxxxx",
}
]
}
}],
total: 3,
offset: 0,
}
# 7. 错误码
以下是本接口的错误码列表,其他错误码可参考 通用错误码;调用接口遇到报错,可使用官方提供的 API 诊断工具 辅助定位和分析问题。
| 错误码 | 错误描述 |
|---|---|
| -10403 | 无权限操作该评价/评论/回复 |
| -10008 | 服务异常 |
| -10007 | 无权限调用接口 |
| -10003 | 参数不匹配 |
| -10001 | 参数异常 |
| 10000 | 和解:不是差评/发送过模板消息;其它:参数异常 |
# 8. 适用范围
本接口支持「小程序」账号类型调用。其他账号类型如无特殊说明,均不可调用。