主题
查询阅读状态2.0
查询应用消息的阅读状态
接口说明
请求URL:http[s]://{网关地址}/mp/restful/v2/readState
请求方式: POST
请求内容类型: application/json
响应内容类型: application/json
请求说明
请求体
| 字段名 | 参数名 | 必填 | 类型 | 描述 |
|---|---|---|---|---|
| 消息Id | msgId | M | String | |
| 签名 | sign | M | String | 请求签名:accessToken + msgId 的MD5值 |
请求示例
使用发送方式
json
{
"msgId":"530742873710592",
"sign":"306b408dacb185de2f7f71325bde0acf"
}1
2
3
4
2
3
4
响应说明
响应体
| 字段名 | 参数名 | 必填 | 类型 | 描述 |
|---|---|---|---|---|
| 状态 | status | 是 | Integer | |
| 信息 | msg | 是 | String | |
| 阅读状态 | readState | 是 | Integer | 0 全部未读 1 部分已读 2 全部已读 |
| 接收者数量 | reciverCount | 是 | Integer |
响应示例
{
"msg": "success",
"status": 200,
"readCount":100,
"reciverCount":100,
}1
2
3
4
5
6
2
3
4
5
6
错误码
| 错误码 | 描述 |
|---|---|
| 200 | 请求成功 |
| 其他 | 失败 |
Demo
java
// 创建客户端
Client client = new DefaultClient(BASE_URL, APP_ID, APP_SECRET);
// 创建请求对象
ReadStateRequest request = new ReadStateRequest();
request.setMsgId("992583753207808");
ReadStateResponse response = client.execute(request);
//调用成功,则处理业务逻辑
if (response.isSuccess()) {
//.....
System.out.println(JSONObject.toJSONString(response));
} else {
throw new Exception("查询阅读状态异常:" + JSONObject.toJSONString(response));
}1
2
3
4
5
6
7
8
9
10
11
12
13
2
3
4
5
6
7
8
9
10
11
12
13

