# 查询评价详情

> 接口应在服务器端调用，不可在前端（小程序、网页、APP等）直接调用，具体可参考[接口调用指南](/doc/oplatform/developers/dev/guide.md)。

接口英文名：getCommentInfo

查询某条评价的详细内容

## 1. 调用方式

### HTTPS 调用

```bash
GET https://api.weixin.qq.com/wxaapi/comment/commentinfo/get?access_token=ACCESS_TOKEN
```

### 云调用

- 本接口不支持云调用。

### 第三方调用

- 本接口支持第三方平台代商家调用。

- 该接口所属的权限集 id 为：151

- 服务商获得其中之一权限集授权后，可通过使用 [authorizer_access_token](/doc/oplatform/developers/dev/AuthorizerAccessToken.md) 代商家进行调用，具体可查看 [第三方调用](/doc/oplatform/Third-party_Platforms/2.0/Before_Develop/call_interface.md) 说明文档。

## 2. 请求参数

### 查询参数 `Query String Parameters`

```json
[
  {
    "参数名": "access_token",
    "类型": "string",
    "必填": "是",
    "示例": "ACCESS_TOKEN",
    "说明": "接口调用凭证，可使用 [access_token](/miniprogram/dev/server/API/mp-access-token/api_getaccesstoken)、[authorizer_access_token](/doc/oplatform/openApi/ticket-token/api_getauthorizeraccesstoken.md)"
  }
]
```

### 请求体 `Request Payload`

```json
[
  {
    "参数名": "commentId",
    "类型": "string",
    "必填": "是",
    "说明": "评价的 id"
  }
]
```

## 3. 返回参数

### 返回体 `Response Payload`

```json
[
  {
    "参数名": "info",
    "类型": "object",
    "说明": "评价的信息"
  },
  {
    "参数名": "processInfo",
    "类型": "object",
    "说明": "进度条的信息（只有差评才会有）"
  },
  {
    "参数名": "oldComment",
    "类型": "object",
    "说明": "旧评价的信息(只有改评的新评价才有)"
  }
]
```

### Res.info `Object Payload`

评价的信息

```json
[
  {
    "参数名": "content",
    "类型": "object",
    "说明": "评价"
  }
]
```

### Res.processInfo `Object Payload`

进度条的信息（只有差评才会有）

```json
[
  {
    "参数名": "actionList",
    "类型": "objarray",
    "说明": "进度的具体状态,数组类型，从数组最后往前数有updateTime的就是当前状态"
  },
  {
    "参数名": "commentId",
    "类型": "string",
    "说明": "评价进度对应的评价id"
  }
]
```

### Res.oldComment `Object Payload`

旧评价的信息(只有改评的新评价才有)

```json
[
  {
    "参数名": "commentId",
    "类型": "string",
    "说明": "评价id"
  },
  {
    "参数名": "createTime",
    "类型": "string",
    "说明": "创建时间，单位是秒"
  },
  {
    "参数名": "score",
    "类型": "number",
    "说明": "用户评价的打分，每100对应1分以及1颗星"
  },
  {
    "参数名": "content",
    "类型": "object",
    "说明": "评论的内容"
  }
]
```

### Res.info.content `Object Payload`

评价

```json
[
  {
    "参数名": "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`

商家订单信息

```json
[
  {
    "参数名": "busiOrderId",
    "类型": "string",
    "说明": "商户单号：商户系统内部订单号，只能是数字、大小写字母_-*且在同一个商户号下唯一；是微信支付接口文档中的 out_trade_no"
  }
]
```

### Res.info.content.productInfo `Object Payload`

评价商品信息

```json
[
  {
    "参数名": "productList",
    "类型": "objarray",
    "说明": "商品列表"
  }
]
```

">

### Res.info.content.productInfo.productList(Array) `Object Payload`

商品列表

```json
[
  {
    "参数名": "name",
    "类型": "string",
    "说明": "商品名"
  },
  {
    "参数名": "picUrl",
    "类型": "string",
    "说明": "商品图片"
  }
]
```

### Res.info.content.userInfo `Object Payload`

评价用户信息

```json
[
  {
    "参数名": "openid",
    "类型": "string",
    "说明": "评价用户openid"
  },
  {
    "参数名": "headImg",
    "类型": "string",
    "说明": "评价用户的头像"
  },
  {
    "参数名": "nickName",
    "类型": "string",
    "说明": "评价用户的昵称"
  }
]
```

### Res.info.content.bizInfo `Object Payload`

商家小程序信息

```json
[
  {
    "参数名": "appid",
    "类型": "string",
    "说明": "商家小程序的appid"
  },
  {
    "参数名": "headImg",
    "类型": "string",
    "说明": "商家小程序的头像"
  },
  {
    "参数名": "nickName",
    "类型": "string",
    "说明": "商家小程序的昵称"
  }
]
```

### Res.info.content.content `Object Payload`

评价内容

```json
[
  {
    "参数名": "media",
    "类型": "objarray",
    "说明": "评价的媒体文件，如图片、视频"
  },
  {
    "参数名": "txt",
    "类型": "string",
    "说明": "评价内容"
  }
]
```

">

### Res.info.content.content.media(Array) `Object Payload`

评价的媒体文件，如图片、视频

```json
[
  {
    "参数名": "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的就是当前状态

```json
[
  {
    "参数名": "type",
    "类型": "number",
    "说明": "进度的类型",
    "枚举": "枚举值"
  },
  {
    "参数名": "updateTime",
    "类型": "number",
    "说明": "更新时间，processInfo.actionList里从后往前数第一个有更新时间的就是当前状态",
    "枚举": "-"
  }
]
```

### Res.oldComment.content `Object Payload`

评论的内容

```json
[
  {
    "参数名": "ext",
    "类型": "string",
    "说明": "评价的文本内容"
  },
  {
    "参数名": "media",
    "类型": "objarray",
    "说明": "评价的多媒体内容,跟上面提到的媒体结构一致"
  }
]
```

">

### Res.oldComment.content.media(Array) `Object Payload`

评价的多媒体内容,跟上面提到的媒体结构一致

```json
[
  {
    "参数名": "img",
    "类型": "string",
    "说明": "图片cdn"
  },
  {
    "参数名": "thumbImg",
    "类型": "string",
    "说明": "缩略图cdn"
  },
  {
    "参数名": "video",
    "类型": "string",
    "说明": "视频资源cdn（有img的时候没有video）"
  },
  {
    "参数名": "videoCover",
    "类型": "string",
    "说明": "缩略图cdn（有img的时候没有videoCover）"
  },
  {
    "参数名": "videoDuration",
    "类型": "number",
    "说明": "视频时长，单位秒（有img的时候没有videoDuration）"
  }
]
```

## 4. 枚举信息

__type">

### Res.processInfo.actionList(Array).type `Enum`

进度的类型

```json
[
  {
    "枚举值": "1",
    "描述": "发表差评"
  },
  {
    "枚举值": "2",
    "描述": "开发者处理"
  },
  {
    "枚举值": "3",
    "描述": "用户调研"
  },
  {
    "枚举值": "4",
    "描述": "用户改评"
  }
]
```

## 5. 注意事项

本接口无特殊注意事项

## 6. 代码示例

请求示例

```bash
GET https://api.weixin.qq.com/wxaapi/comment/commentinfo/get?commentId=123456&access_token=xxxxxx
```

返回示例

```json
{
  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. 错误码

以下是本接口的错误码列表，其他错误码可参考 [通用错误码](/doc/oplatform/developers/errCode/README.md)；调用接口遇到报错，可使用官方提供的 [API 诊断工具](https://developers.weixin.qq.com/console/devtools/debug?utm_source=api_errcode) 辅助定位和分析问题。

```json
[
  {
    "错误码": "-10403",
    "错误描述": "无权限操作该评价/评论/回复"
  },
  {
    "错误码": "-10008",
    "错误描述": "服务异常"
  },
  {
    "错误码": "-10007",
    "错误描述": "无权限调用接口"
  },
  {
    "错误码": "-10003",
    "错误描述": "参数不匹配"
  },
  {
    "错误码": "-10001",
    "错误描述": "参数异常"
  },
  {
    "错误码": "10000",
    "错误描述": "和解：不是差评/发送过模板消息；其它：参数异常"
  }
]
```

## 8. 适用范围

本接口支持「小程序」账号类型调用。其他账号类型如无特殊说明，均不可调用。
