产品动态
公告
https://www.example.com。https://www.example.com?SdkAppid=$SDKAppID&CallbackCommand=$CallbackCommand&contenttype=json&ClientIP=$ClientIP&OptPlatform=$OptPlatform
参数 | 说明 |
https | 请求协议为 HTTPS,请求方式为 POST。 |
www.example.com | 回调 URL。 |
SdkAppid | 创建应用时在即时通信 Chat 控制台分配的 SDKAppID。 |
CallbackCommand | 固定为 Bot.OnC2CMessage。 |
contenttype | 固定值为 json。 |
ClientIP | 客户端 IP,格式例如:127.0.0.1。 |
OptPlatform |
{"CallbackCommand": "Bot.OnC2CMessage", // 回调命令"From_Account": "jared", // 发送者"To_Account": "Jonh", // 接收者"MsgSeq": 48374, // 消息序列号"MsgRandom": 2837546, // 消息随机数"MsgTime": 1557481126, // 消息的发送时间戳,单位为秒"MsgKey": "48374_2837546_1557481126", // 消息的唯一标识,可用于 REST API 撤回单聊消息"OnlineOnlyFlag":1,//是否仅发送给在线用户标识。1代表仅发送给在线用户,否则为0;"SendMsgResult": 0, // 该条消息的下发结果"ErrorInfo": "send msg succeed", // 该条消息下发失败的错误信息,若消息发送成功,则为"send msg succeed""MsgBody": [ // 消息体{"MsgType": "TIMTextElem", // 文本"MsgContent": {"Text": "red packet"}}],"CloudCustomData": "your cloud custom data","EventTime": 1670574414123 //毫秒级别,事件触发时间戳}
字段 | 类型 | 说明 |
CallbackCommand | String | 回调命令。 |
From_Account | String | 消息发送者 UserID。 |
To_Account | String | 消息接收者 UserID。 |
MsgSeq | Integer | 消息序列号,用于标记该条消息(32位无符号整数)。 |
MsgRandom | Integer | 消息随机数,用于标记该条消息(32位无符号整数)。 |
MsgTime | Integer | 消息的发送时间戳,单位为秒。 单聊消息优先使用 MsgTime 进行排序,同一秒发送的消息则按 MsgSeq 排序,MsgSeq 值越大消息越靠后。 |
MsgKey | String | |
OnlineOnlyFlag | Integer | 是否仅发送给在线用户标识。1代表仅发送给在线用户,否则为0。 |
SendMsgResult | Integer | |
ErrorInfo | String | 该条消息下发失败的错误信息,若消息发送成功,则为"send msg succeed"。 |
MsgBody | Array | |
CloudCustomData | String | 消息自定义数据(云端保存,会发送到对端,程序卸载重装后还能拉取到)。 |
EventTime | Integer | 事件触发的毫秒级别时间戳。 |
{"ActionStatus": "OK","ErrorInfo": "","ErrorCode": 0 // 0为回调成功,1为回调出错}
字段 | 类型 | 属性 | 说明 |
ActionStatus | String | 必填 | 请求处理的结果: OK 表示处理成功。 FAIL 表示失败。 |
ErrorCode | Integer | 必填 | 错误码: 0为回调成功。 1为回调出错。 |
ErrorInfo | String | 必填 | 错误信息。 |
文档反馈