Skip to content

Commit 3af185c

Browse files
authored
docs: update batch send message. (#152)
1 parent a719b7e commit 3af185c

2 files changed

Lines changed: 211 additions & 0 deletions

File tree

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
---
2+
sidebar_position: 13
3+
title: 批量发送消息
4+
hide_title: true
5+
---
6+
7+
<center>
8+
9+
## 批量发送消息
10+
11+
</center>
12+
13+
### 简要描述
14+
- 批量发送消息。
15+
### 请求方式
16+
- `post`
17+
### 请求URL
18+
- `http://x.x.x.x:10002/msg/batch_send_msg`
19+
20+
21+
### Header
22+
|header名|示例值|选填|类型|说明|
23+
|:---- |:------- |:--- |---|------ |
24+
|operationID|1646445464564|必填|string|operationID用于全局链路追踪|
25+
|token|eyJhbxxxx3Xs|必填|string|管理员token|
26+
27+
### 请求参数示例
28+
29+
30+
```json
31+
{
32+
"sendID": "openIMAdmin",
33+
"senderNickname": "Gordon",
34+
"senderFaceURL": "http://www.head.com",
35+
"senderPlatformID": 1,
36+
"content": {
37+
"text": "{\"content\":\"hello world!\"}"
38+
},
39+
"contentType": 101,
40+
"sessionType": 1,
41+
"isOnlineOnly": false,
42+
"notOfflinePush": false,
43+
"offlinePushInfo": {
44+
"title": "send message",
45+
"desc": "",
46+
"ex": "",
47+
"iOSPushSound": "default",
48+
"iOSBadgeCount": true
49+
},
50+
"isSendAll": true
51+
}
52+
```
53+
|字段名|选填|类型|说明|
54+
|:---- |:------- |:--- |---|
55+
|sendID|必填|string|发送者ID(可以为管理员ID,可以为用户ID)|
56+
|recvIDs|选填|array|接收者ID列表,sessionType1或者4,必填,为接收方用户ID,如果是群聊则不填|
57+
|senderNickname|选填|string|发送者昵称|
58+
|senderFaceURL|选填|string|发送者头像|
59+
|senderPlatformID|选填|int|发送者平台号,模拟用户发送时填写, 1-&gt;IOS,2-&gt;Android,3-&gt;Windows,4-&gt;OSX,5-&gt;Web,5-&gt;MiniWeb,7-&gt;Linux,8-&gt;AndroidPad,9-&gt;IPad|
60+
|content|必填|object|消息的具体内容,内部是json 对象,其他消息的详细字段请参考消息类型格式描述文档|
61+
|contentType|必填|int|消息类型,101表示文本,102表示图片..详细参考消息类型格式描述文档|
62+
|sessionType|必填|int|会话类型,发送的消息是单聊还是群聊,单聊为1,群聊(普通写扩散)为2,大群(读扩散接口)为3,通知会话为4|
63+
|isOnlineOnly|选填|boolean|该字段设置为true时候,发送的消息服务器不会存储,接收者在线才会收到,不在线该消息丢失|
64+
|notOfflinePush|选填|string|该字段设置为true时候,发送的消息在用户离线时将不会进行离线推送|
65+
|offlinePushInfo|选填|object|离线推送的具体内容,如果不填写,使用服务器默认推送标题|
66+
|offlinePushInfo.title|选填|string|推送的标题|
67+
|offlinePushInfo.desc|选填|string|推送的具体描述|
68+
|offlinePushInfo.ex|选填|string|扩展字段|
69+
|offlinePushInfo.iOSPushSound|选填|string|IOS的推送声音|
70+
|offlinePushInfo.iOSBadgeCount|选填|string|IOS推送消息是否计入桌面图标未读数|
71+
|isSendAll|选填|boolean|是否发送给全部人|
72+
### 成功返回示例
73+
74+
75+
```json
76+
77+
```
78+
### 成功返回示例的参数说明
79+
80+
81+
|参数名|类型|说明|
82+
|:---- |:------- |:--- |
83+
|errCode|int|错误码,0表示成功|
84+
|errMsg|string|错误简要信息,无错误时为空|
85+
|errDlt|errDlt|错误详细信息,无错误时为空|
86+
|data|object|通用数据对象,具体结构见下方|
87+
### 失败返回示例
88+
89+
90+
```json
91+
{
92+
"errCode": 1004,
93+
"errMsg": "RecordNotFoundError",
94+
"errDlt": ": [1004]RecordNotFoundError"
95+
}
96+
```
97+
### 失败返回示例的参数说明
98+
99+
100+
|参数名|类型|说明|
101+
|:---- |:------- |:--- |
102+
|errCode|int|错误码,具体查看全局错误码文档|
103+
|errMsg|string|错误简要信息|
104+
|errDlt|errDlt|错误详细信息|
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
---
2+
sidebar_position: 13
3+
title: batch_send_msg
4+
hide_title: true
5+
---
6+
7+
<center>
8+
9+
## Batch Send Message
10+
11+
</center>
12+
13+
### Brief Description
14+
- Batch send messages.
15+
16+
### Request Method
17+
- `POST`
18+
19+
### Request URL
20+
- `http://x.x.x.x:10002/msg/batch_send_msg`
21+
22+
### Header
23+
| Header Name | Example Value | Required | Type | Description |
24+
|:----------- |:-------------- |:-------- |------- |------------------------------------- |
25+
| operationID | 1646445464564 | Required | string | operationID used for global tracing |
26+
| token | eyJhbxxxx3Xs | Required | string | Admin token |
27+
28+
### Request Parameter Example
29+
30+
```json
31+
{
32+
"sendID": "openIMAdmin",
33+
"senderNickname": "Gordon",
34+
"senderFaceURL": "http://www.head.com",
35+
"senderPlatformID": 1,
36+
"content": {
37+
"text": "{\"content\":\"hello world!\"}"
38+
},
39+
"contentType": 101,
40+
"sessionType": 1,
41+
"isOnlineOnly": false,
42+
"notOfflinePush": false,
43+
"offlinePushInfo": {
44+
"title": "send message",
45+
"desc": "",
46+
"ex": "",
47+
"iOSPushSound": "default",
48+
"iOSBadgeCount": true
49+
},
50+
"isSendAll": true
51+
}
52+
```
53+
54+
### Parameter Description
55+
56+
| Field Name | Required | Type | Description |
57+
|:---------------- |:-------- |------- |--------------------------------------------------------------------------- |
58+
| sendID | Required | string | Sender ID (can be admin ID or user ID) |
59+
| recvIDs | Optional | array | List of receiver IDs, required for sessionType 1 or 4, for individual user chats; leave empty for group chats |
60+
| senderNickname | Optional | string | Sender's nickname |
61+
| senderFaceURL | Optional | string | Sender's profile picture URL |
62+
| senderPlatformID | Optional | int | Sender's platform ID, fill when simulating user sending: 1->iOS, 2->Android, 3->Windows, 4->OSX, 5->Web, 6->MiniWeb, 7->Linux, 8->AndroidPad, 9->iPad |
63+
| content | Required | object | The actual message content, internally a JSON object, for details refer to the message type format documentation |
64+
| contentType | Required | int | Message type, 101 for text, 102 for image, etc. Refer to message type format documentation for more details |
65+
| sessionType | Required | int | Conversation type, 1 for individual chat, 2 for group chat (normal write spread), 3 for large group (read spread interface), 4 for notification conversation |
66+
| isOnlineOnly | Optional | boolean| When set to true, the message is not stored on the server; only online recipients will receive the message, and the message will be lost if they are offline |
67+
| notOfflinePush | Optional | boolean| When set to true, the message will not trigger offline push notifications for offline users |
68+
| offlinePushInfo | Optional | object | Offline push notification details, if not provided, default server push title is used |
69+
| offlinePushInfo.title | Optional | string | Push notification title |
70+
| offlinePushInfo.desc | Optional | string | Push notification description |
71+
| offlinePushInfo.ex | Optional | string | Extension field |
72+
| offlinePushInfo.iOSPushSound| Optional | string | iOS push sound |
73+
| offlinePushInfo.iOSBadgeCount| Optional| boolean| Whether the iOS push notification increments the badge count on the app icon|
74+
| isSendAll | Optional | boolean| Whether to send to all users |
75+
76+
### Success Response Example
77+
78+
```json
79+
80+
```
81+
82+
### Success Response Parameter Description
83+
84+
| Parameter Name | Type | Description |
85+
|:-------------- |:----- |----------------------------------------- |
86+
| errCode | int | Error code, 0 indicates success |
87+
| errMsg | string| Brief error message, empty if no error |
88+
| errDlt | string| Detailed error message, empty if no error|
89+
| data | object| General data object, refer to the structure below|
90+
91+
### Failure Response Example
92+
93+
```json
94+
{
95+
"errCode": 1004,
96+
"errMsg": "RecordNotFoundError",
97+
"errDlt": ": [1004]RecordNotFoundError"
98+
}
99+
```
100+
101+
### Failure Response Parameter Description
102+
103+
| Parameter Name | Type | Description |
104+
|:-------------- |:----- |-------------------------- |
105+
| errCode | int | Error code, refer to the global error code documentation for details |
106+
| errMsg | string| Brief error message |
107+
| errDlt | string| Detailed error message |

0 commit comments

Comments
 (0)