Skip to content

Commit 164c228

Browse files
committed
docs: add webhook createConversations docs.
1 parent 0c2876d commit 164c228

File tree

5 files changed

+421
-0
lines changed

5 files changed

+421
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"label": "会话相关回调",
3+
"collapsible": true,
4+
"collapsed": true
5+
}
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
---
2+
title: 创建用户群聊会话之后的回调
3+
hide_title: true
4+
---
5+
6+
# 创建用户群聊会话之后的回调
7+
8+
## 功能说明
9+
10+
App 业务服务端可以通过该回调实时查看创建群聊会话的信息,包括:接收消息选项、是否置顶会话和开启阅后即焚、附加信息和 ex 信息。
11+
12+
## 注意事项
13+
14+
- 为启用回调,必须配置回调 URL,并开启本条回调协议对应的开关。配置方法详见 [回调说明](../introduction) 文档。
15+
- 回调的方向是 OpenIMServer 向 App 后台发起 HTTP/HTTPS POST 请求。
16+
- APP 业务服务端需在超时时间内响应此请求。
17+
18+
## 可能触发该回调的场景
19+
20+
- App 用户通过客户端发起将其他用户拉入群的请求和同意用户进入群聊时创建。
21+
- App 管理员通过 REST API 添加用户到群组和同意用户进入群组。
22+
23+
## 回调发生时机
24+
25+
- OpenIMServer 完成创建用户群聊会话的操作后。
26+
27+
## 接口说明
28+
29+
### 请求 URL 示例
30+
31+
此处`CallbackCommand`为:`callbackAfterCreateGroupChatConversationsCommand`
32+
33+
```plaintext
34+
{WEBHOOK_ADDRESS}/callbackAfterCreateGroupChatConversationsCommand?contenttype=json
35+
```
36+
37+
### 请求包示例
38+
39+
```json
40+
{
41+
"callbackCommand": "callbackAfterCreateGroupChatConversationsCommand",
42+
"owner_user_id": "12332123",
43+
"conversation_id": "sg_126354623",
44+
"conversation_type": 3,
45+
"group_id": "126354623",
46+
"recv_msg_opt": 0,
47+
"is_pinned": false,
48+
"is_private_chat": false,
49+
"burn_duration": 0,
50+
"group_at_type": 0,
51+
"attached_info": "337845818",
52+
"ex": "3Q"
53+
}
54+
```
55+
56+
### 请求包字段说明
57+
58+
| 对象 | 类型 | 描述 |
59+
| ---------------- | ------- | ------------------------------------------------------------------------- |
60+
| callbackCommand | string | 回调命令,这里是创建群聊会话之后的回调。 |
61+
| ownerUserID | string | 会话的拥有者用户 ID |
62+
| conversationID | string | 会话 ID |
63+
| conversationType | int | 会话类型,3 为群聊 |
64+
| groupID | string | 会话的群 ID,当会话类型为 3 时,此字段生效 |
65+
| recvMsgOpt | int | 接收消息参数,0 为接收消息;1 为不接收消息;2 为接收消息但不提醒 |
66+
| isPinned | boolean | 会话是否置顶 |
67+
| isPrivateChat | boolean | 是否开启阅后即焚 |
68+
| burnDuration | int | 阅后即焚消息持续时间 |
69+
| groupAtType | int | 群会话公告强提示类型,群公告有人**@ownerUserID** , **@全体** 的特殊标识符 |
70+
| attachedInfo | string | openIM 使用的拓展字段 |
71+
| ex | string | 用户使用的拓展字段 |
72+
73+
## 应答包示例
74+
75+
### 创建完成
76+
77+
确认用户创建群聊会话已完成。
78+
79+
```json
80+
{
81+
"actionCode": 0,
82+
"errCode": 0,
83+
"errMsg": "",
84+
"errDlt": "",
85+
"nextCode": 0
86+
}
87+
```
88+
89+
## 应答包字段说明
90+
91+
| 字段 || 说明 |
92+
| ---------- | ---------------------------- | --------------------------------------------------------------------------------------------------- |
93+
| actionCode | 0 | 表示业务系统的回调是否正确执行。`0`表示操作成功。 |
94+
| errCode | 5001 | 表示自定义错误码,范围在 5000-9999 之间。在 actionCode 不等于 0 时设置;在 nextCode 等于 1 时设置。 |
95+
| errMsg | "An error message" | 自定义错误码对应的简单错误信息。 |
96+
| errDlt | "Detailed error information" | 自定义错误码对应的详细错误信息。 |
97+
| nextCode | 1 | 下一步执行指令,actionCode 等于`0`时设置,`1`表示拒绝继续执行。 |
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
---
2+
title: 创建群聊会话之前的回调
3+
hide_title: true
4+
---
5+
6+
# 创建群聊会话之前的回调
7+
8+
## 功能说明
9+
10+
App 业务服务端可以通过该回调实时查看创建群聊会话的请求,包括:App 后台可以在实际创建群聊会话前,对请求进行审核或修改。
11+
12+
## 注意事项
13+
14+
- 为启用回调,必须配置回调 URL,并开启本条回调协议对应的开关。配置方法详见 [回调说明](../introduction) 文档。
15+
- 回调的方向是 OpenIMServer 向 App 后台发起 HTTP/HTTPS POST 请求。
16+
- APP 业务服务端需在超时时间内响应此请求。
17+
18+
## 可能触发该回调的场景
19+
20+
- App 用户通过客户端发起将其他用户拉入群的请求和同意用户进入群聊时创建。
21+
- App 管理员通过 REST API 添加用户到群组和同意用户进入群组。
22+
23+
## 回调发生时机
24+
25+
- OpenIMServer 准备创建用户群聊会话之前进行回调。
26+
27+
## 接口说明
28+
29+
### 请求 URL 示例
30+
31+
此处`CallbackCommand`为:`callbackBeforeCreateGroupChatConversationsCommand`
32+
33+
```plaintext
34+
{WEBHOOK_ADDRESS}/callbackBeforeCreateGroupChatConversationsCommand?contenttype=json
35+
```
36+
37+
### 请求包示例
38+
39+
```json
40+
{
41+
"callbackCommand": "callbackBeforeCreateGroupChatConversationsCommand",
42+
"owner_user_id": "12332123",
43+
"conversation_id": "sg_126354623",
44+
"conversation_type": 3,
45+
"group_id": "126354623",
46+
"recv_msg_opt": 0,
47+
"is_pinned": false,
48+
"is_private_chat": false,
49+
"burn_duration": 0,
50+
"group_at_type": 0,
51+
"attached_info": "337845818",
52+
"ex": "3Q"
53+
}
54+
```
55+
56+
### 请求包字段说明
57+
58+
| 对象 | 类型 | 描述 |
59+
| ---------------- | ------- | ------------------------------------------------------------------------- |
60+
| callbackCommand | string | 回调命令,这里是创建群聊会话之前的回调。 |
61+
| ownerUserID | string | 会话的拥有者用户 ID |
62+
| conversationID | string | 会话 ID |
63+
| conversationType | int | 会话类型,3 为群聊 |
64+
| groupID | string | 会话的群 ID,当会话类型为 3 时,此字段生效 |
65+
| recvMsgOpt | int | 接收消息参数,0 为接收消息;1 为不接收消息;2 为接收消息但不提醒 |
66+
| isPinned | boolean | 会话是否置顶 |
67+
| isPrivateChat | boolean | 是否开启阅后即焚 |
68+
| burnDuration | int | 阅后即焚消息持续时间 |
69+
| groupAtType | int | 群会话公告强提示类型,群公告有人**@ownerUserID** , **@全体** 的特殊标识符 |
70+
| attachedInfo | string | openIM 使用的拓展字段 |
71+
| ex | string | 用户使用的拓展字段 |
72+
73+
## 应答包示例
74+
75+
### 允许创建
76+
77+
允许用户创建群聊会话。
78+
79+
```json
80+
{
81+
"actionCode": 0,
82+
"errCode": 0,
83+
"errMsg": "",
84+
"errDlt": "",
85+
"nextCode": 0,
86+
"recv_msg_opt": 0,
87+
"is_pinned": false,
88+
"is_private_chat": false,
89+
"burn_duration": 0,
90+
"group_at_type": 0,
91+
"attached_info": "337845818",
92+
"ex": "3Q"
93+
}
94+
```
95+
96+
## 应答包字段说明
97+
98+
| 字段 || 说明 |
99+
| ------------- | ---------------------------- | --------------------------------------------------------------------------------------------------- |
100+
| actionCode | 0 | 表示业务系统的回调是否正确执行。`0`表示操作成功。 |
101+
| errCode | 5001 | 表示自定义错误码,范围在 5000-9999 之间。在 actionCode 不等于 0 时设置;在 nextCode 等于 1 时设置。 |
102+
| errMsg | "An error message" | 自定义错误码对应的简单错误信息。 |
103+
| errDlt | "Detailed error information" | 自定义错误码对应的详细错误信息。 |
104+
| nextCode | 1 | 下一步执行指令,actionCode 等于`0`时设置,`1`表示拒绝继续执行。 |
105+
| recvMsgOpt | int | 接收消息参数,0 为接收消息;1 为不接收消息;2 为接收消息但不提醒 |
106+
| isPinned | boolean | 会话是否置顶 |
107+
| isPrivateChat | boolean | 是否开启阅后即焚 |
108+
| burnDuration | int | 阅后即焚消息持续时间 |
109+
| groupAtType | int | 群会话公告强提示类型,群公告有人**@ownerUserID** , **@全体** 的特殊标识符 |
110+
| attachedInfo | string | openIM 使用的拓展字段 |
111+
| ex | string | 用户使用的拓展字段 |
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
---
2+
title: 创建单聊会话之后的回调
3+
hide_title: true
4+
---
5+
6+
# 创建单聊会话之后的回调
7+
8+
## 功能说明
9+
10+
App 业务服务端可以通过该回调实时查看创建单聊会话的信息,包括:接收消息选项、是否置顶会话和阅后即焚、附加信息和 ex 信息。
11+
12+
## 注意事项
13+
14+
- 为启用回调,必须配置回调 URL,并开启本条回调协议对应的开关。配置方法详见 [回调说明](../introduction) 文档。
15+
- 回调的方向是 OpenIMServer 向 App 后台发起 HTTP/HTTPS POST 请求。
16+
- APP 业务服务端需在超时时间内响应此请求。
17+
18+
## 可能触发该回调的场景
19+
20+
- App 用户通过客户端点击与其未创建过会话用户的聊天框时或好友通过时发送通知消息时。
21+
- App 管理员通过 REST API 向没有聊天过的用户发送信息或添加好友通过时。
22+
23+
## 回调发生时机
24+
25+
- OpenIMServer 完成创建用户单聊会话的操作后。
26+
27+
## 接口说明
28+
29+
### 请求 URL 示例
30+
31+
此处`CallbackCommand`为:`callbackAfterCreateSingleChatConversationsCommand`
32+
33+
```plaintext
34+
{WEBHOOK_ADDRESS}/callbackAfterCreateSingleChatConversationsCommand?contenttype=json
35+
```
36+
37+
### 请求包示例
38+
39+
```json
40+
{
41+
"callbackCommand": "callbackAfterCreateSingleChatConversationsCommand",
42+
"owner_user_id": "112345",
43+
"conversation_id": "si_112345_1654321",
44+
"conversation_type": 1,
45+
"user_id": "1654321",
46+
"recv_msg_opt": 0,
47+
"is_pinned": false,
48+
"is_private_chat": false,
49+
"burn_duration": 0,
50+
"group_at_type": 0,
51+
"attached_info": "Are you OK?",
52+
"ex": "RUOK"
53+
}
54+
```
55+
56+
### 请求包字段说明
57+
58+
| 对象 | 类型 | 描述 |
59+
| ---------------- | ------- | ------------------------------------------------------------------------- |
60+
| CallbackCommand | string | 回调命令,这里是创建单聊会话之后的回调的回调。 |
61+
| ownerUserID | string | 会话的拥有者用户 ID |
62+
| conversationID | string | 会话 ID |
63+
| conversationType | int | 会话类型,1 为单聊 |
64+
| userID | string | 会话用户 ID,当会话类型为 1 时,此字段生效 |
65+
| recvMsgOpt | int | 接收消息参数,0 为接收消息;1 为不接收消息;2 为接收消息但不提醒 |
66+
| isPinned | boolean | 会话是否置顶 |
67+
| isPrivateChat | boolean | 是否开启阅后即焚 |
68+
| burnDuration | int | 阅后即焚消息持续时间 |
69+
| groupAtType | int | 群会话公告强提示类型,群公告有人**@ownerUserID** , **@全体** 的特殊标识符 |
70+
| attachedInfo | string | openIM 使用的拓展字段 |
71+
| ex | string | 用户使用的拓展字段 |
72+
73+
## 应答包示例
74+
75+
### 创建完成
76+
77+
确认用户创建单聊会话已完成。
78+
79+
```json
80+
{
81+
"actionCode": 0,
82+
"errCode": 0,
83+
"errMsg": "",
84+
"errDlt": "",
85+
"nextCode": 0
86+
}
87+
```
88+
89+
## 应答包字段说明
90+
91+
| 字段 || 说明 |
92+
| ---------- | ---------------------------- | --------------------------------------------------------------------------------------------------- |
93+
| actionCode | 0 | 表示业务系统的回调是否正确执行。`0`表示操作成功。 |
94+
| errCode | 5001 | 表示自定义错误码,范围在 5000-9999 之间。在 actionCode 不等于 0 时设置;在 nextCode 等于 1 时设置。 |
95+
| errMsg | "An error message" | 自定义错误码对应的简单错误信息。 |
96+
| errDlt | "Detailed error information" | 自定义错误码对应的详细错误信息。 |
97+
| nextCode | 1 | 下一步执行指令,actionCode 等于`0`时设置,`1`表示拒绝继续执行。 |

0 commit comments

Comments
 (0)