App 后台可以通过该回调实时查看用户创建群组的信息,包括: 通知 App 后台有群组创建成功,App 后台可以据此进行数据同步等操作。
群组创建成功之后。
以下示例中 App 配置的回调 URL 为 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 | 创建应用时在即时通信 IM 控制台分配的 SDKAppID |
CallbackCommand | 固定为 Group.CallbackAfterCreateGroup |
contenttype | 固定值为 JSON |
ClientIP | 客户端 IP,格式如:127.0.0.1 |
OptPlatform | 客户端平台,取值参见 第三方回调简介:回调协议 中 OptPlatform 的参数含义 |
{
"CallbackCommand": "Group.CallbackAfterCreateGroup", // 回调命令
"GroupId" : "@TGS#2J4SZEAEL",
"Operator_Account": "group_root", // 操作者
"Owner_Account": "leckie", // 群主
"Type": "Public", // 群组类型
"Name": "MyFirstGroup", // 群组名称
"MemberList": [ // 初始成员列表
{
"Member_Account": "bob"
},
{
"Member_Account": "peter"
}
],
"UserDefinedDataList": [ //用户建群时的自定义字段
{
"Key": "UserDefined1",
"Value": "hello"
},
{
"Key": "UserDefined2",
"Value": "world"
}
],
"EventTime":"1670574414123"//毫秒级别,事件触发时间戳
}
字段 | 类型 | 说明 |
---|---|---|
CallbackCommand | String | 回调命令 |
GroupId | String | 操作的群 ID |
Operator_Account | String | 发起创建群组请求的操作者 UserID |
Owner_Account | String | 请求创建的群的群主 UserID |
Type | String | 请求创建的 群组类型介绍,例如 Public |
Name | String | 请求创建的群组的名称 |
MemberList | Array | 请求创建的群组的初始化成员列表 |
UserDefinedDataList | Array | 用户建群时的自定义字段,这个字段默认是没有的,需要开通,详见 自定义字段 |
EventTime | Integer | 事件触发的毫秒级别时间戳 |
App 后台同步数据后,发送回调应答包。
{
"ActionStatus": "OK",
"ErrorInfo": "",
"ErrorCode": 0 // 忽略回调结果
}
字段 | 类型 | 属性 | 说明 |
---|---|---|---|
ActionStatus | String | 必填 | 请求处理的结果,OK 表示处理成功,FAIL 表示失败 |
ErrorCode | Integer | 必填 | 错误码,此处填0表示忽略应答结果 |
ErrorInfo | String | 必填 | 错误信息 |
本页内容是否解决了您的问题?