主题
查询发送状态2.0
查询应用消息的发送状态
接口说明
请求URL:http[s]://{网关地址}/mp/restful/v2/sendState
请求方式: 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 | M | Integer | 状态 200成功 其他失败 |
| 信息 | msg | M | String | 信息 |
| 接收者发送数量 | receiverSendCount | M | Integer | 接收者发送数量 |
| 接收者数量 | reciverCount | M | Integer | 接收者数量 |
| 发送状态 | sendState | M | Integer | 发送状态,0 待发送 1 发送中 2 部分成功 3 全部成功 4 全部失败 |
响应示例
{
"msg": "success",
"status": 200,
"receiverSendCount": 1,
"reciverCount": 1,
"sendState": 3
}1
2
3
4
5
6
7
2
3
4
5
6
7
错误码
| 错误码 | 描述 |
|---|---|
| 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

