diff --git a/docs/restapi/apis/messageManagement/batchSendMessage.mdx b/docs/restapi/apis/messageManagement/batchSendMessage.mdx new file mode 100644 index 0000000000..c0badcc3e6 --- /dev/null +++ b/docs/restapi/apis/messageManagement/batchSendMessage.mdx @@ -0,0 +1,104 @@ +--- +sidebar_position: 13 +title: 批量发送消息 +hide_title: true +--- + +
+ +## 批量发送消息 + +
+ +### 简要描述 +- 批量发送消息。 +### 请求方式 +- `post` +### 请求URL +- `http://x.x.x.x:10002/msg/batch_send_msg` + + +### Header +|header名|示例值|选填|类型|说明| +|:---- |:------- |:--- |---|------ | +|operationID|1646445464564|必填|string|operationID用于全局链路追踪| +|token|eyJhbxxxx3Xs|必填|string|管理员token| + +### 请求参数示例 + + +```json +{ + "sendID": "openIMAdmin", + "senderNickname": "Gordon", + "senderFaceURL": "http://www.head.com", + "senderPlatformID": 1, + "content": { + "text": "{\"content\":\"hello world!\"}" + }, + "contentType": 101, + "sessionType": 1, + "isOnlineOnly": false, + "notOfflinePush": false, + "offlinePushInfo": { + "title": "send message", + "desc": "", + "ex": "", + "iOSPushSound": "default", + "iOSBadgeCount": true + }, + "isSendAll": true +} +``` +|字段名|选填|类型|说明| +|:---- |:------- |:--- |---| +|sendID|必填|string|发送者ID(可以为管理员ID,可以为用户ID)| +|recvIDs|选填|array|接收者ID列表,sessionType1或者4,必填,为接收方用户ID,如果是群聊则不填| +|senderNickname|选填|string|发送者昵称| +|senderFaceURL|选填|string|发送者头像| +|senderPlatformID|选填|int|发送者平台号,模拟用户发送时填写, 1->IOS,2->Android,3->Windows,4->OSX,5->Web,5->MiniWeb,7->Linux,8->AndroidPad,9->IPad| +|content|必填|object|消息的具体内容,内部是json 对象,其他消息的详细字段请参考消息类型格式描述文档| +|contentType|必填|int|消息类型,101表示文本,102表示图片..详细参考消息类型格式描述文档| +|sessionType|必填|int|会话类型,发送的消息是单聊还是群聊,单聊为1,群聊(普通写扩散)为2,大群(读扩散接口)为3,通知会话为4| +|isOnlineOnly|选填|boolean|该字段设置为true时候,发送的消息服务器不会存储,接收者在线才会收到,不在线该消息丢失| +|notOfflinePush|选填|string|该字段设置为true时候,发送的消息在用户离线时将不会进行离线推送| +|offlinePushInfo|选填|object|离线推送的具体内容,如果不填写,使用服务器默认推送标题| +|offlinePushInfo.title|选填|string|推送的标题| +|offlinePushInfo.desc|选填|string|推送的具体描述| +|offlinePushInfo.ex|选填|string|扩展字段| +|offlinePushInfo.iOSPushSound|选填|string|IOS的推送声音| +|offlinePushInfo.iOSBadgeCount|选填|string|IOS推送消息是否计入桌面图标未读数| +|isSendAll|选填|boolean|是否发送给全部人| +### 成功返回示例 + + +```json + +``` +### 成功返回示例的参数说明 + + +|参数名|类型|说明| +|:---- |:------- |:--- | +|errCode|int|错误码,0表示成功| +|errMsg|string|错误简要信息,无错误时为空| +|errDlt|errDlt|错误详细信息,无错误时为空| +|data|object|通用数据对象,具体结构见下方| +### 失败返回示例 + + +```json +{ + "errCode": 1004, + "errMsg": "RecordNotFoundError", + "errDlt": ": [1004]RecordNotFoundError" +} +``` +### 失败返回示例的参数说明 + + +|参数名|类型|说明| +|:---- |:------- |:--- | +|errCode|int|错误码,具体查看全局错误码文档| +|errMsg|string|错误简要信息| +|errDlt|errDlt|错误详细信息| diff --git a/i18n/en/docusaurus-plugin-content-docs-restapi/current/apis/messageManagement/batchSendMessage.mdx b/i18n/en/docusaurus-plugin-content-docs-restapi/current/apis/messageManagement/batchSendMessage.mdx new file mode 100644 index 0000000000..f7b7fc2c7c --- /dev/null +++ b/i18n/en/docusaurus-plugin-content-docs-restapi/current/apis/messageManagement/batchSendMessage.mdx @@ -0,0 +1,107 @@ +--- +sidebar_position: 13 +title: batch_send_msg +hide_title: true +--- + +
+ +## Batch Send Message + +
+ +### Brief Description +- Batch send messages. + +### Request Method +- `POST` + +### Request URL +- `http://x.x.x.x:10002/msg/batch_send_msg` + +### Header +| Header Name | Example Value | Required | Type | Description | +|:----------- |:-------------- |:-------- |------- |------------------------------------- | +| operationID | 1646445464564 | Required | string | operationID used for global tracing | +| token | eyJhbxxxx3Xs | Required | string | Admin token | + +### Request Parameter Example + +```json +{ + "sendID": "openIMAdmin", + "senderNickname": "Gordon", + "senderFaceURL": "http://www.head.com", + "senderPlatformID": 1, + "content": { + "text": "{\"content\":\"hello world!\"}" + }, + "contentType": 101, + "sessionType": 1, + "isOnlineOnly": false, + "notOfflinePush": false, + "offlinePushInfo": { + "title": "send message", + "desc": "", + "ex": "", + "iOSPushSound": "default", + "iOSBadgeCount": true + }, + "isSendAll": true +} +``` + +### Parameter Description + +| Field Name | Required | Type | Description | +|:---------------- |:-------- |------- |--------------------------------------------------------------------------- | +| sendID | Required | string | Sender ID (can be admin ID or user ID) | +| recvIDs | Optional | array | List of receiver IDs, required for sessionType 1 or 4, for individual user chats; leave empty for group chats | +| senderNickname | Optional | string | Sender's nickname | +| senderFaceURL | Optional | string | Sender's profile picture URL | +| 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 | +| content | Required | object | The actual message content, internally a JSON object, for details refer to the message type format documentation | +| contentType | Required | int | Message type, 101 for text, 102 for image, etc. Refer to message type format documentation for more details | +| 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 | +| 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 | +| notOfflinePush | Optional | boolean| When set to true, the message will not trigger offline push notifications for offline users | +| offlinePushInfo | Optional | object | Offline push notification details, if not provided, default server push title is used | +| offlinePushInfo.title | Optional | string | Push notification title | +| offlinePushInfo.desc | Optional | string | Push notification description | +| offlinePushInfo.ex | Optional | string | Extension field | +| offlinePushInfo.iOSPushSound| Optional | string | iOS push sound | +| offlinePushInfo.iOSBadgeCount| Optional| boolean| Whether the iOS push notification increments the badge count on the app icon| +| isSendAll | Optional | boolean| Whether to send to all users | + +### Success Response Example + +```json + +``` + +### Success Response Parameter Description + +| Parameter Name | Type | Description | +|:-------------- |:----- |----------------------------------------- | +| errCode | int | Error code, 0 indicates success | +| errMsg | string| Brief error message, empty if no error | +| errDlt | string| Detailed error message, empty if no error| +| data | object| General data object, refer to the structure below| + +### Failure Response Example + +```json +{ + "errCode": 1004, + "errMsg": "RecordNotFoundError", + "errDlt": ": [1004]RecordNotFoundError" +} +``` + +### Failure Response Parameter Description + +| Parameter Name | Type | Description | +|:-------------- |:----- |-------------------------- | +| errCode | int | Error code, refer to the global error code documentation for details | +| errMsg | string| Brief error message | +| errDlt | string| Detailed error message |