主题
根据账号查询消息详情并将消息设置为已读 3.5.5.SP2+
根据账号查询消息详情并将消息设置为已读
接口说明
请求URL:http[s]://{网关地址}/mp/restful/v2/setMsgRead
请求方式: POST
请求内容类型: application/json
响应内容类型: application/json
请求说明
请求体
| 字段名 | 参数名 | 必填 | 类型 |
|---|---|---|---|
| 收件箱id | id | M | string |
| 应用消息id | msgId | M | string |
| 用户账号 | userAccount | M | string |
请求示例
json
{
"id":"857348250122240",
"msgId":"857348250081280",
"userAccount":"ampadmin"
}1
2
3
4
5
2
3
4
5
响应说明
响应体
| 字段名 | 参数名 | 类型 | 描述 |
|---|---|---|---|
| 状态码 | code | String | 0000请求成功 |
| 错误内容 | msg | string | 错误内容 |
| 数据 | data | MsgDetailVo | 消息详情 |
| 字段名 | 参数名 | 类型 |
|---|---|---|
| 应用名字 | appName | string |
| 附件 | attachments | List |
| 是否删除 0 否 1是 | isDeleted | string |
| 消息内容 | msgContent | string |
| 应用消息id | msgId | string |
| 消息发送时间yyyy-MM-dd HH:mm:ss | msgSendDate | string |
| 消息标题 | msgTitle | string |
| 发送方式 2:今日校园 3:邮箱 4短信 5企业微信 6 钉钉 7 微信服务号 8 welink | sendType | List |
响应示例
json
{
"code": "0000",
"data": {
"result": [
{
"appId": "casp.cal",
"appName": "Schedule aggregation",
"collected": 0,
"id": "857348250122240",
"inboxUrl": "http://172.16.72.222:8080/message_pocket_web/inboxh5/h5.html#/messageDetail?id=857348250122240&msgId=857348250081280&from=SystemDetail",
"isDeleted": 0,
"isReaded": 0,
"msgContent": "2023/07/17 00:00:00 - 2023/07/21 23:59:59 11111 2023/07/17 08:00:00 - 2023/07/17 09:00:00",
"msgId": "857348250081280",
"msgSendDate": "2023-07-16 12:00:03",
"msgTitle": "2023/07/17 - 2023/07/23",
"msgType": 0,
"sendType": [
"1",
"2"
]
}
],
"totalSize": 3417
}
}1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
错误码
| 错误码 | 描述 |
|---|---|
| 0000 | 请求成功 |
| 其他 | 失败 |
Demo
java
Client client = new DefaultClient(BASE_URL, APP_ID, APP_SECRET);
SetMsgReadRequest request = new SetMsgReadRequest();
request.setId("880053759021056");
request.setUserAccount("01119092");
request.setMsgId("992583753207808");
SetMsgReadResponse 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
2
3
4
5
6
7
8
9
10
11

