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
| Parameter | Data Type | Required | Description | |
|---|---|---|---|---|
| event_type | string | Yes | Event type. For message subscriptions, this value is message. | |
| timestamp | int64 | Yes | Event timestamp in milliseconds. | |
| payload | array | Yes | List of message events. | |
| payload[].platform | string | Yes | Platform from which the message was sent. Valid values: iOS, Android, Web, PC, and Server. | |
| payload[].sender | string | Yes | Message sender ID. Maximum length: 32 characters. | |
| payload[].receiver | string | Yes | Message recipient ID. Maximum length: 32 characters. | |
| payload[].conver_type | int | Yes | Conversation type. 1: private chat; 2: group chat; 3: chatroom. | |
| payload[].msg_type | string | Yes | Message type identifier. Maximum length: 50 characters. | |
| payload[].msg_content | string | Yes | Message content. JSON format is recommended. | |
| payload[].mention_info.mention_type | string | No | Mention type. mention_all: mention everyone; mention_someone: mention specified users; mention_all_someone: mention everyone and specified users. | |
| payload[].mention_info.target_user_ids | array | No | IDs of the users mentioned when specified users are mentioned. Each user ID can contain up to 32 characters. | |
| payload[].msg_id | string | Yes | Message ID. | |
| payload[].msg_time | int64 | Yes | Time 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
}
]
}