Skip to content

Commit 19422c7

Browse files
authored
Merge pull request #1267 from haoxiuwen/doc-v2
Add Callback Event for Group Read Ack
2 parents de54e01 + b77181e commit 19422c7

File tree

4 files changed

+98
-16
lines changed

4 files changed

+98
-16
lines changed

docs/.vuepress/sidebar/document.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,7 @@ const documentSidebar = [
490490
{ text: '用户登入/登出', link: 'callback_login_logout.html' },
491491
{ text: '发送消息', link: 'callback_message_send.html' },
492492
{ text: '发送单聊消息已读回执', link: 'callback_single_read_ack.html' },
493+
{ text: '发送群聊消息已读回执', link: 'callback_group_read_ack.html' },
493494
{ text: '发送会话已读回执', link: 'callback_single_conversation_ack.html' },
494495
{ text: '修改消息', link: 'callback_message_modify.html' },
495496
{ text: '撤回消息', link: 'callback_message_recall.html' },
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# 发送群组消息已读回执
2+
3+
成功发送群组消息已读回执后,环信服务器会按照 [发送后回调规则](/product/enable_and_configure_IM.html#配置回调规则) 向你的 App Server 发送回调请求,App Server 可通过该回调已读回执信息,进行数据同步。
4+
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+
## 回调请求
16+
17+
### 请求示例
18+
19+
下面的请求示例为发送群组消息已读回执。
20+
21+
```json
22+
{
23+
"callId": "XXXX#XXXX_1406088760298309588",
24+
"channel_channel": "XXXX#[email protected]",
25+
"eventType": "chat",
26+
"channel_user": "XXXX#[email protected]",
27+
"chat_type": "read_ack",
28+
"security": "bc392b82e70e24cc1ea29e08aa41765d",
29+
"content_type": "chat:ack:read",
30+
"payload": {
31+
"ext": {},
32+
"ack_message_id": "1406088702140090324",
33+
"msg_config": {
34+
"allow_group_ack": true
35+
},
36+
"type": "read_ack"
37+
},
38+
"writed_channel": false,
39+
"host": "easemob@hsb-im-msync0",
40+
"appkey": "eXXXX#XXXX",
41+
"from": "tst",
42+
"to": "277721224642561",
43+
"msg_id": "1406088760298309588",
44+
"timestamp": 1744945351097
45+
}
46+
```
47+
48+
### 请求字段说明
49+
50+
| 字段 | 数据类型 | 含义 |
51+
| :---------- | :------- | :----------------------------------------------------------- |
52+
| `callId` | String | `callId` 为每个回调请求的唯一标识,格式为 `App Key_回执消息的消息 ID`|
53+
| `channel_channel` | String | 群聊消息的已读回执,格式为 `App Key_群组 [email protected]`,例如,示例中的 `easemob-demo#[email protected]`|
54+
| `eventType` | String | `chat`:表示上行消息。 |
55+
| `security` | String | 签名,格式如下: `MD5(callId+secret+timestamp)`。Secret 见 [Console 后台回调规则](/product/enable_and_configure_IM.html#配置回调规则)|
56+
| `payload` | object | 包括:<br/> - `ext`:消息扩展字段<br/> - `ack_message_id`:消息 ID<br/> - `msg_config.allow_group_ack`:是否需要群消息已读回执 <br/> - `type``read_ack` 表示消息已读回执。|
57+
| `host` | String | 服务器名称。 |
58+
| `appkey` | String | 你在环信管理后台注册的应用唯一标识。 |
59+
| `from` | String | 发送已读回执的用户 ID。 |
60+
| `to` | String | 群组 ID。 |
61+
| `msg_id` | String | 该回执消息的消息 ID。 |
62+
| `timestamp` | long | 环信 IM 服务器收到消息已读回执的 Unix 时间戳,单位为 ms。 |

docs/document/server-side/callback_group_room_create.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# 创建群组/聊天室事件
2+
23
成功创建群组或聊天室后,环信服务器会按照[发送后回调规则](/product/enable_and_configure_IM.html#配置回调规则)向你的 App Server 发送回调请求,App Server 可通过该回调查看创建的群组/聊天室的信息,进行数据同步。
34

45
:::tip
Lines changed: 34 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,28 @@
11
# 发送单聊消息已读回执
22

3-
回调请求主要字段含义:
3+
成功发送单聊消息已读回执后,环信服务器会按照 [发送后回调规则](/product/enable_and_configure_IM.html#配置回调规则) 向你的 App Server 发送回调请求,App Server 可通过该回调已读回执信息,进行数据同步。
44

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+
## 回调请求
1816

19-
回调请求示例:
17+
### 请求示例
18+
19+
下面的请求示例为发送单聊消息已读回执。
2020

2121
```json
2222
{
2323
"chat_type": "read_ack",
2424
"callId": "XXXX#XXXX_968665325555943556",
25+
"channel_channel": "XXXX#[email protected]",
2526
"security": "bd63d5fa8f72823e6d33e09a43aa4239",
2627
"payload": {
2728
"ext": {},
@@ -36,4 +37,21 @@
3637
"msg_id": "968665325555943556",
3738
"timestamp": 1643099771248
3839
}
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

Comments
 (0)