云端审核结果回调
功能说明
开启内容理解后,审核结果可以通过配置基础回调的方式,将结果转发给 App 后台。
注意事项
要启用回调,必须配置回调 URL,并打开本回调对应的开关,配置方法详见 第三方回调简介 文档。
回调的方向是Chat 后台向 App 后台发起 HTTP POST 请求。
App 后台在收到回调请求之后,务必校验请求 URL 中的参数 SDKAppID 是否是自己的 SDKAppID。
默认仅回调违规审核结果,可以按需配置为所有审核结果均回调到App后台。
接口说明
请求 URL 示例
以下示例中 App 配置的回调 URL 为
https://www.example.com示例:
https://www.example.com?SdkAppid=$SDKAppID&CallbackCommand=$CallbackCommand&contenttype=json
请求参数说明
字段 | 说明 |
https | 请求协议为 HTTPS。 请求方式为 POST。 |
www.example.com | 回调 URL。 |
SdkAppid | 创建应用时在Chat 控制台分配的 SDKAppID。 |
CallbackCommand | 固定为: ContentCallback.ResultNotify。 |
contenttype | 请求包体固定为 json。 |
请求包示例
{"Scene":"C2C","SdkAppId":1400187352,"From_Account":"jared","ContactItem":{"ContactType":1,"To_Account":"Jonh"},"ContentType":"Text","TextContent":["aaabbbccc","1234567"],"MsgID":"1434460578_4137340972_1661154487","CtxcbResult":1,"CtxcbRequestId":"241ed925-4c56-4357-95dd-1e6e7798f214","CtxcbKeywords":["aaabbbccc","1234567"],"CtxcbSuggestion":"Review","CtxcbLabel":"Sexy","CtxcbSubLabel":"InsinuationPorn","CtxcbSubLabelDesc":"影射XX","CtxcbLibName":"test","CloudCustomData":"aaabbbccc"}
请求包字段说明
字段 | 类型 | 说明 |
Scene | String | 送审场景: 单聊 = C2C 单聊自定义消息 = C2CCustom 群聊 = Group 群聊自定义消息 = GroupCustom 群资料 = GroupInfo 群成员资料 = GroupMemberInfo 关系链 = RelationChain 用户资料 = UserInfo |
From_Account | String | 送审内容的发起者的 UserID。 |
ContactItem | Object | 消息送审时,表示消息接收对象。 |
ContactType | Integer | 消息送审时,区分接收对象为群组或单聊: ContactType = 1表示单聊。 ContactType = 2表示群聊。 |
To_Account | String | ContactType = 1时,表示消息接收方 UserID。 |
ToGroupId | String | ContactType = 2时,表示消息接收方 GroupID。 |
ContentType | String | 表示送审的内容类型: 文本 = Text 图片 = Image 音频 = Audio 视频 = Video |
TextContent | Array | 当 ContentType 为 Text 时,表示送审的文本内容。文本自定义消息可能存在多个数组成员返回,其他消息只有一个数组成员返回。 |
FileURL | String | 当 ContentType 为 Image/Audio/Video 时,表示送审的文件 URL。 |
MsgID | String | 单聊送审,MsgID 为单聊消息 MsgKey。 群聊送审,MsgID 为群聊消息 MsgSeq。 其中群消息如果没有 MsgID,则表示违规拦截或者非审核环节导致消息没下发。 |
CtxcbResult | Integer | Chat 处置策略: 1:表示拦截。 0:表示放过。 |
CtxcbRequestId | String | 第三方内容服务审核标识。 |
CtxcbKeywords | Array | 文本命中的敏感词。 |
CtxcbSuggestion | String | 第三方内容审核服务审核建议: Block/Review/Normal。 |
CtxcbLabel | String | 审核命中的一级违规分类: Normal/Illegal/Abuse/Polity/Ad/Porn/Sexy/Terror/Composite。 |
CtxcbSubLabel | String | 审核命中的二级违规分类,只有模型命中的情况才有该值。 |
CtxcbSubLabelDesc | String | 审核命中的二级违规分类对应的中文描述。 |
CtxcbLibName | String | 关键词命中的自定义关键词库名称,只有关键词命中的情况才有该值。 |
CloudCustomData | String | 单聊或者群聊消息审核,消息体中对应的自定义字段 CloudCustomData 原样返回。其他场景审核该字段为空。 |
应答包示例
{"ActionStatus": "OK","ErrorInfo": "","ErrorCode": 0}
应答包字段说明
字段 | 类型 | 说明 |
ActionStatus | String | 请求处理的结果: OK 表示处理成功。 FAIL 表示失败。 |
ErrorCode | Integer | 错误码: 0:表示 App 后台处理成功。 1:表示 App 后台处理失败。 |
ErrorInfo | String | 错误信息。 |