Skip to main content

Send Business Notification

Brief Description

  • Business service sends custom notification, the client will receive OnRecvCustomBusinessMessage callback.

Request Method

  • post

Request URL

  • {API_ADDRESS}/msg/send_business_notification
Header NameExample ValueOptionalTypeDescription
operationID1646445464564RequiredstringUsed for global link tracking, timestamp is recommended, independent in each request
tokeneyJhbxxxx3XsRequiredstringAdmin token

Request Parameter Example

{
"sendUserID": "openIMAdmin",
"recvUserID": "2839678182",
"recvGroupID": "",
"key": "xxx",
"data": "xxxxxx",
"sendMsg": false,
"reliabilityLevel": 1
}
Field NameOptionalTypeDescription
sendUserIDRequiredstringSystem notification number ID, or user ID
recvUserIDOptionalstringReceiver user ID, can only choose one between this and recvGroupID
recvGroupIDOptionalstringReceiver group ID, can only choose one between this and recvUserID
keyRequiredstringBased on business classification, the client can use this field to process data differently
dataRequiredstringBusiness data
sendMsgOptionalboolWhether to send in the form of a message, Default: false
reliabilityLevelOptionalintNotification message reliability level, 1: Online push. 2: Guaranteed notification (Triggered even upon disconnection reconnect or re-login, used for guaranteed scenarios. At this reliability level, due to full sequence synchronization, it's advised not to send too many, as it will affect client message synchronization performance), Default: 1

Success Return Example

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

Parameter Description for Success Return Example

Parameter NameTypeDescription
errCodeintError code, 0 means successful
errMsgstringBrief error message, empty
errDlterrDltDetailed error message, empty
dataobjectGeneric data object, specific structure is below
serverMsgIDstringServer message ID, reserved field
clientMsgIDstringClient message ID, this ID is the unique ID for the message
sendTimeintThe time the message was sent

Failure Return Example

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

Parameter Description for Failure Return Example

Parameter NameTypeDescription
errCodeintError code, specifically check the global error code document
errMsgstringBrief error message
errDlterrDltDetailed error message