https://www.example.com.https://www.example.com?SdkAppid=$SDKAppID&CallbackCommand=$CallbackCommand&contenttype=json&ClientIP=$ClientIP&OptPlatform=$OptPlatform
Parameter | Description |
https | The request protocol is HTTPS, and the request method is POST. |
www.example.com | Callback URL. |
SdkAppid | SDKAppID assigned to an application when the application is created in the Chat console. |
CallbackCommand | The value is fixed as Bot.OnC2CMessage. |
contenttype | The value is fixed as json. |
ClientIP | Client IP address. For example, 127.0.0.1. |
OptPlatform | Client platform. For the valid values, see the description of the OptPlatform parameter in Webhook Protocol on Webhook Overview. |
{"CallbackCommand": "Bot.OnC2CMessage", // Callback command."From_Account": "jared", // Sender."To_Account": "Jonh", // Recipient."MsgSeq": 48374, // Message serial number."MsgRandom": 2837546, // Message random number."MsgTime": 1557481126, // Message sending timestamp, in seconds."MsgKey": "48374_2837546_1557481126", // Unique message identifier, which can be used for recalling a one-to-one message by calling a REST API."OnlineOnlyFlag":1,//Flag indicating whether to send the message only to online users. 1: send only to online users; 0: send to all users."SendMsgResult": 0, // Message sending result."ErrorInfo": "send msg succeed", // Error message returned when message sending fails. If the message is sent successfully, "send msg succeed" is returned."MsgBody": [ // Message body.{"MsgType": "TIMTextElem", // Text."MsgContent": {"Text": "red packet"}}],"CloudCustomData": "your cloud custom data","EventTime": 1670574414123 // Event trigger timestamp, in milliseconds.}
Field | Type | Description |
CallbackCommand | String | Callback command. |
From_Account | String | User ID of the message sender. |
To_Account | String | User ID of the message recipient. |
MsgSeq | Integer | Message serial number (a 32-bit unsigned integer), which is used to identify the message. |
MsgRandom | Integer | Message random number (a 32-bit unsigned integer), which is used to identify the message. |
MsgTime | Integer | Message sending timestamp, in seconds. MsgTime is preferentially used for sorting one-to-one messages. For messages sent in the same second, MsgSeq is used for sorting. A message is sent more recently if its MsgSeq value is larger. |
MsgKey | String | Unique identifier of the message, which can be used for withdrawing a one-to-one message by calling a REST API. |
OnlineOnlyFlag | Integer | Flag indicating whether to send the message only to online users. 1: send only to online users; 0: send to all users. |
SendMsgResult | Integer | Sending result of the message. 0: sending successful; other values: sending failed. See Error Codes for details. |
ErrorInfo | String | Error message returned when message sending fails. If the message is sent successfully, "send msg succeed" is returned. |
MsgBody | Array | |
CloudCustomData | String | Custom message data. (It is saved on the cloud and will be sent to the recipient. It can still be obtained after Chat is uninstalled and then reinstalled.) |
EventTime | Integer | Event trigger timestamp, in milliseconds. |
{"ActionStatus": "OK","ErrorInfo": "","ErrorCode": 0 // 0: callback successful; 1: callback error.}
Field | Type | Required | Description |
ActionStatus | String | Required | Request processing result: OK: processing successful. FAIL: processing failed. |
ErrorCode | Integer | Required | Error Code: 0: callback successful. 1: callback error. |
ErrorInfo | String | Required | Error message. |
Feedback