Batch Send Message
Brief Description
- Batch send messages.
Request Method
POST
Request URL
{API_ADDRESS}/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
{
"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
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
{
"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 |