|
1 | 1 | # 发送单聊消息已读回执
|
2 | 2 |
|
3 |
| -回调请求主要字段含义: |
| 3 | +成功发送单聊消息已读回执后,环信服务器会按照 [发送后回调规则](/product/enable_and_configure_IM.html#配置回调规则) 向你的 App Server 发送回调请求,App Server 可通过该回调已读回执信息,进行数据同步。 |
4 | 4 |
|
5 |
| -| 字段 | 数据类型 | 含义 | |
6 |
| -| :---------- | :------- | :----------------------------------------------------------- | |
7 |
| -| `chat_type` | String | `read_ack` 已读回执。 | |
8 |
| -| `callId` | String | `callId` 为每个回调请求的唯一标识,格式为 “App Key_回执消息的消息 ID”。 | |
9 |
| -| `security` | String | 签名,格式如下: `MD5(callId+secret+timestamp)`。 Secret 见 [Console 后台回调规则](/product/enable_and_configure_IM.html#配置回调规则)。 | |
10 |
| -| `payload` | object | 包括:<br/> - `ext`:消息扩展字段<br/> - `ack_message_id`:消息 ID<br/> - `bodies`:消息体内容。 | |
11 |
| -| `host` | String | 服务器名称。 | |
12 |
| -| `appkey` | String | 你在环信管理后台注册的应用唯一标识。 | |
13 |
| -| `from` | String | 发送已读回执用户 ID。 | |
14 |
| -| `to` | String | 接收已读回执用户 ID。 | |
15 |
| -| `eventType` | String | `chat`:单聊。 | |
16 |
| -| `timestamp` | long | 环信 IM 服务器收到消息已读回执的 Unix 时间戳,单位为 ms。 | |
17 |
| -| `msg_id` | String | 该回执消息的消息 ID。 | |
| 5 | +:::tip |
| 6 | +1. 你所使用的环信即时通讯 IM 的版本可能需要单独开通回调服务,详见 [增值服务说明](/product/pricing.html#增值服务费用)。 |
| 7 | +2. 如果需要发送单聊消息已读回执的回调事件,你需要在 [环信控制台](https://console.easemob.com/user/login) 配置发送后回调规则,详见 [配置回调规则](/product/enable_and_configure_IM.html#配置回调规则)。 |
| 8 | +3. 发送后回调的相关介绍,详见 [回调说明](/document/server-side/callback_postsending.html)。 |
| 9 | +::: |
| 10 | + |
| 11 | +## 回调时机 |
| 12 | + |
| 13 | +客户端发送单聊消息已读回执。 |
| 14 | + |
| 15 | +## 回调请求 |
18 | 16 |
|
19 |
| -回调请求示例: |
| 17 | +### 请求示例 |
| 18 | + |
| 19 | +下面的请求示例为发送单聊消息已读回执。 |
20 | 20 |
|
21 | 21 | ```json
|
22 | 22 | {
|
23 | 23 | "chat_type": "read_ack",
|
24 | 24 | "callId": "XXXX#XXXX_968665325555943556",
|
| 25 | + "channel_channel": "XXXX#[email protected]", |
25 | 26 | "security": "bd63d5fa8f72823e6d33e09a43aa4239",
|
26 | 27 | "payload": {
|
27 | 28 | "ext": {},
|
|
36 | 37 | "msg_id": "968665325555943556",
|
37 | 38 | "timestamp": 1643099771248
|
38 | 39 | }
|
39 |
| -``` |
| 40 | +``` |
| 41 | + |
| 42 | +### 请求字段说明 |
| 43 | + |
| 44 | +| 字段 | 数据类型 | 含义 | |
| 45 | +| :---------- | :------- | :----------------------------------------------------------- | |
| 46 | +| `chat_type` | String | `read_ack` 已读回执。 | |
| 47 | +| `callId` | String | `callId` 为每个回调请求的唯一标识,格式为 “App Key_回执消息的消息 ID”。 | |
| 48 | +| `channel_channel` | String | 单聊消息的已读回执,格式为 `App Key_接收已读回执用户 [email protected]`,例如,示例中的 `easemob-demo#[email protected]`。 | |
| 49 | +| `security` | String | 签名,格式如下: `MD5(callId+secret+timestamp)`。 Secret 见 [Console 后台回调规则](/product/enable_and_configure_IM.html#配置回调规则)。 | |
| 50 | +| `payload` | object | 包括:<br/> - `ext`:消息扩展字段<br/> - `ack_message_id`:消息 ID<br/> - `bodies`:消息体内容。 | |
| 51 | +| `host` | String | 服务器名称。 | |
| 52 | +| `appkey` | String | 你在环信管理后台注册的应用唯一标识。 | |
| 53 | +| `from` | String | 发送已读回执用户 ID。 | |
| 54 | +| `to` | String | 接收已读回执用户 ID。 | |
| 55 | +| `eventType` | String | `chat`:单聊。 | |
| 56 | +| `timestamp` | long | 环信 IM 服务器收到消息已读回执的 Unix 时间戳,单位为 ms。 | |
| 57 | +| `msg_id` | String | 该回执消息的消息 ID。 | |
0 commit comments