Batch Send Messages
Brief Description
- Sends messages in batch to multiple recipients.
Request Method
post
Request URL
{API_ADDRESS}/msg/batch_send_msg
Header
Header Name | Example Value | Optional | Type | Description |
---|---|---|---|---|
operationID | 1646445464564 | Required | string | Used for global trace tracking, suggested to use a unique timestamp per request |
token | eyJhbxxxx3Xs | Required | string | Admin token |
Request Parameters Example
{
"recvIDs": [
"9948077346",
"9371245179"
],
"sendID": "3473643418",
"senderNickname": "Alice",
"senderFaceURL": "http://nvpydodr.ae/ylyqu",
"senderPlatformID": 2,
"content": {
"content": "hello!!"
},
"contentType": 101,
"sessionType": 1,
"isOnlineOnly": false,
"notOfflinePush": false,
"sendTime": 1340619319058,
"offlinePushInfo": {
"title": "1213",
"desc": "in eiusmod magna",
"ex": "ex",
"iOSPushSound": "in Duis ut sunt nostrud",
"iOSBadgeCount": true
},
"ex": "ex",
"isSendAll": true
}
Field Name | Optional | Type | Description |
---|---|---|---|
recvIDs | Optional | array | List of recipient IDs. For session types 1 or 4, required for user ID; leave blank for group chat. |
sendID | Required | string | Sender ID (can be admin or user ID). |
senderNickname | Optional | string | Sender's nickname. |
senderFaceURL | Optional | string | Sender's avatar URL. |
senderPlatformID | Optional | int | Sender's platform type. |
content | Required | object | Message content, a JSON object. See message format documentation. |
contentType | Required | int | Message type. |
sessionType | Required | int | Session type. |
isOnlineOnly | Optional | boolean | If true, message is only sent when the receiver is online and won't be stored. |
notOfflinePush | Optional | boolean | If true, message will not trigger offline push notifications when the user is offline. |
sendTime | Optional | int | Timestamp of message sending in milliseconds. |
offlinePushInfo | Optional | object | Offline push content details; uses default server title if not provided. Not used if notOfflinePush is true. |
offlinePushInfo.title | Optional | string | Push notification title. |
offlinePushInfo.desc | Optional | string | Push notification description. |
offlinePushInfo.ex | Optional | string | Extension field for push notification. |
offlinePushInfo.iOSPushSound | Optional | string | iOS push notification sound. |
offlinePushInfo.iOSBadgeCount | Optional | boolean | Whether iOS push notification counts in app badge. |
ex | Optional | string | Extension field. |
isSendAll | Optional | boolean | Whether to send to all users. |
Success Response Example
{
"errCode": 0,
"errMsg": "",
"errDlt": "",
"data": {
"results": [
{
"serverMsgID": "b30cb040685c1ff3e92b32d25826a06e",
"clientMsgID": "ec5792358392cf9168eff64adfa4ac6a",
"sendTime": 1340619319058,
"recvID": "imAdmin"
},
{
"serverMsgID": "5f0987ef1bbdcd565c85befb1a084035",
"clientMsgID": "ec5792358392cf9168eff64adfa4ac6a",
"sendTime": 1340619319058,
"recvID": "3473643418"
},
{
"serverMsgID": "9ba70b63487559db1857ce324ae3bcf0",
"clientMsgID": "ec5792358392cf9168eff64adfa4ac6a",
"sendTime": 1340619319058,
"recvID": "9948077346"
},
{
"serverMsgID": "56f483592c3ee9fff1465d9b23277408",
"clientMsgID": "ec5792358392cf9168eff64adfa4ac6a",
"sendTime": 1340619319058,
"recvID": "9371245179"
},
{
"serverMsgID": "ee8b6bbd3190753bc0713c1085ccb479",
"clientMsgID": "ec5792358392cf9168eff64adfa4ac6a",
"sendTime": 1340619319058,
"recvID": "6412123282"
}
],
"failedUserIDs": null
}
}
Success Response Parameters Description
Parameter Name | Type | Description |
---|---|---|
errCode | int | Error code; 0 indicates success. |
errMsg | string | Brief error message, empty if none. |
errDlt | errDlt | Detailed error information, empty if none. |
data | object | General data object, structure detailed below. |
data.results | array | List of result objects. |
serverMsgID | string | Server message ID, a reserved field. |
clientMsgID | string | Client message ID, unique per message. |
sendTime | int | Timestamp of message sending. |
recvID | string | Recipient ID. |
data.failedUserIDs | array | List of user IDs where message sending failed. |
Failure Response Example
{
"errCode": 1004,
"errMsg": "RecordNotFoundError",
"errDlt": ": [1004]RecordNotFoundError"
}
Failure Response Parameters Description
Parameter Name | Type | Description |
---|---|---|
errCode | int | Error code, refer to global error code documentation |
errMsg | string | Brief error message |
errDlt | errDlt | Detailed error information |