Skip to main content

Send Business Notification

Brief Description

  • The business service sends a custom notification, and the client receives the OnRecvCustomBusinessMessage callback

Request Method

  • post

Request URL

  • {API_ADDRESS}/msg/send_business_notification
Header NameExample ValueOptionalTypeDescription
operationID1646445464564RequiredstringUsed for global trace tracking; suggested to use a unique timestamp per request
tokeneyJhbxxxx3XsRequiredstringAdmin token

Request Parameters Example

{
"sendUserID": "openIMAdmin",
"recvUserID": "2839678182",
"recvGroupID": "",
"key": "xxx",
"data": "xxxxxx",
"sendMsg": false,
"reliabilityLevel": 1
}
Field NameOptionalTypeDescription
sendUserIDRequiredstringSystem notification ID, or user ID
recvUserIDOptionalstringReceiver user ID, can only choose one from recvGroupID
recvGroupIDOptionalstringReceive group ID, you can only choose one from recvUserID
keyRequiredstringDepending on the business classification, the client can process data in different ways by changing the field
dataRequiredstringBusiness data
sendMsgOptionalboolWhether to send as a message, default: false
reliabilityLevelOptionalintThe reliability of notification messages is as follows: 1: Online push. 2: Must-reach notification (will also be triggered by disconnection and reconnection or re-login, used for scenarios where must-reach notifications are required. At this reliability level, since it is a sequential full synchronization, it is recommended not to send too many messages, otherwise it will affect the client message synchronization performance). Default: 1

Success Response Example

{
"errCode": 0,
"errMsg": "",
"errDlt": "",
"data": {
"serverMsgID": "8698dd5d163dd79b8fdfa333fee06f40",
"clientMsgID": "1ca0e4cf279ad5cce6b28331b2b42092",
"sendTime": 1679558586210
}
}

Success Response Parameters Description

Parameter NameTypeDescription
errCodeintError code; 0 indicates success
errMsgstringBrief error message, empty if none
errDlterrDltDetailed error information, empty if none
dataobjectGeneral data object, structure detailed below
serverMsgIDstringServer message ID; reserved field
clientMsgIDstringClient message ID; unique ID for message
sendTimeintTime the message was sent

Failure Response Example

{
"errCode": 1004,
"errMsg": "RecordNotFoundError",
"errDlt": ": [1004]RecordNotFoundError"
}

Failure Response Parameters Description

Parameter NameTypeDescription
errCodeintError code, refer to global error code documentation
errMsgstringBrief error message
errDlterrDltDetailed error information