Skip to main content

Request

Webhook authentication: Add authentication headers to the request. See Authentication.

Delivery result: To acknowledge successful delivery, your application server must respond with HTTP status code 200.

Delivery mechanism: Message delivery is attempted up to three times at 100 ms intervals. If all three attempts fail, the delivery is considered unsuccessful. Delivery uses Google's adaptive circuit breaker. If too many requests fail within a sliding time window, the circuit breaker is triggered and delivery to your application server is temporarily suspended.

Request Parameters

ParameterData TypeRequiredDescription
event_typestringYesEvent type. For message subscriptions, this value is message.
timestampint64YesEvent timestamp in milliseconds.
payloadarrayYesList of message events.
payload[].platformstringYesPlatform from which the message was sent. Valid values: iOS, Android, Web, PC, and Server.
payload[].senderstringYesMessage sender ID. Maximum length: 32 characters.
payload[].receiverstringYesMessage recipient ID. Maximum length: 32 characters.
payload[].conver_typeintYesConversation type. 1: private chat; 2: group chat; 3: chatroom.
payload[].msg_typestringYesMessage type identifier. Maximum length: 50 characters.
payload[].msg_contentstringYesMessage content. JSON format is recommended.
payload[].mention_info.mention_typestringNoMention type. mention_all: mention everyone; mention_someone: mention specified users; mention_all_someone: mention everyone and specified users.
payload[].mention_info.target_user_idsarrayNoIDs of the users mentioned when specified users are mentioned. Each user ID can contain up to 32 characters.
payload[].msg_idstringYesMessage ID.
payload[].msg_timeint64YesTime when the message was sent, as a timestamp in milliseconds.

Request Example

POST /message/notification HTTP/1.1
appkey: appkey
signature: 2e639ae3600a4sdff61fb88b76f485b
nonce: nonce
timestamp: 1672568121910
Content-Type: application/json

{
"event_type": "message", //event type: message or online, offline
"timestamp": 1713456000000, //timestamp in milliseconds
"payload": [
{
"platform":"iOS",// iOS/Android/Web/PC/Server
"sender": "userid1", //senduid
"receiver": "userid2", //receiveuid
"conver_type": 1, // 1:private 2:group 3:chatroom
"msg_type": "text",
"msg_content": "Hello, world!",
"mention_info":{
"mention_type":"mention_all",
"target_user_ids":["userid1","userid2"]
},
"msg_id": "123",
"msg_time": 1718980832156
}
]
}