托管信息审核结果回调
当托管资料触发审核时,融云可以将审核结果实时状态同步到您的应用服务器。
开通服务
调用此接口前,您须在控制台开通信息托管审核功能。
回调方法
请求方法: POST
数据格式: application/json
即时通讯服务端会在 POST 请求 URL 中添加签名参数,您可通过签名验证调用者身份和数据有效性,详见服务端回调签名。
正文参数
该回调服务的 HTTP 请求正文数据格式为 application/json
,包含具有以下结构的 JSON 对象:
参数 | 类型 | 必传 | 说明 |
---|---|---|---|
eventType | Number | 是 | 1,群组资料审核;2,群成员资料审核;3,用户资料审核;4,好友资料审核 |
result | Boolean | 是 | 本次审核结果,true 为通过,false 为不通过。 |
time | Long | 是 | 审核时间 |
optUserId | String | 否 | 操作人 |
targetGroupId | String | 否 | 被操作群ID(群组相关审核时不为空) |
targetUserId | String | 否 | 被操作人ID(好友资料和群成员资料审核时不为空) |
contents | JsonArray | 是 | 审核内容详情 |
contents 结构 | |||
contents[i].key | String | 是 | 审核的字段 key |
contents[i].content | String | 是 | 审核的内容 |
contents[i].result | Boolean | 是 | 本字段审核结果,true 为通过,false 为不通过。 |
回调代码示例
假设您在开通服务页面配置的回调接收地址为 http://example.com/group/info/profile/sync.php
,示例代码如下:
HTTP
POST /user/profile/sync HTTP/1.1
Host: example.com
Content-Type: application/json
{
"eventType":2,
"result":false,
"time":1243444555552,
"optUserId":"optUserId1",
"targetGroupId":"groupId1",
"targetUserId":"targetGroupUserId1",
"contents": [
{
"key":"nickname",
"content":"XXXXX",
"result":true
},
{
"key":"extra",
"content":"XXXXX",
"result":false
}
]
}