tencent cloud

即时通信 IM

主动批量审核接口

Download
Focus Mode
Font Size
Last updated: 2026-03-09 14:10:08

功能说明

开启内容理解后,在 App 后台可以主动调用 REST API 接口,批量送审图文等相关内容,音视频审核请查看 主动审核接口

接口调用说明

请求 URL 示例

https://xxxxxx/v4/im_msg_audit/batch_content_moderation?sdkappid=88888888&identifier=admin&usersig=xxx&random=99999999&contenttype=json

请求参数说明

下表仅列出调用本接口时涉及修改的参数及其说明,更多参数详情请参考 REST API 简介
参数
说明
xxxxxx
当前仅支持新加坡,SDKAppID 所在国家/地区对应的专属域名:
新加坡:adminapisgp.im.qcloud.com
其他数据中心暂不支持。
v4/im_msg_audit/batch_content_moderation
请求接口。
sdkappid
创建应用时Chat 控制台分配的 SDKAppID。
identifier
必须为 App 管理员账号,更多详情请参见 App 管理员
usersig
App 管理员账号生成的签名,具体操作请参见 生成 UserSig
random
请输入随机的32位无符号整数,取值范围0 - 4294967295。
contenttype
请求格式固定值为json

最高调用频率

200次/秒。

请求包示例

{
"AuditName":"Group",
"Contents":[
{
"ContentId":0,
"ContentType":"Text",
"Content":"abc123"
},
{
"ContentId":1,
"ContentType":"Text",
"Content":"abc1234"
},
{
"ContentId":2,
"ContentType":"Image",
"Content":"https://www.simple.com/1.jpg"
},
{
"ContentId":3,
"ContentType":"Text",
"Content":"tttcccc"
}
],
"ExtSender":"sender_xx",
"ExtReceiver":"receiver_yy"
}

请求包字段说明

字段
类型
属性
说明
AuditName
String
必填
表明审核配置。
通用审核配置取值:C2C / Group / UserInfo / GroupInfo / GroupMemberInfo / RelationChain
自定义审核配置取值:自定义审核配置 ID
自定义审核配置需在控制台创建好自定义审核配置 ID,主动审核接口将自定义审核配置 ID 直接赋值AuditName,从而走到自定义审核配置 ID 对应的审核场景。
Contents
Array
必填
批量送审数组,最多支持10个内容批量送审。
ContentId
Integer
必填
内容 ID,数组里各个成员,不能重复的 ContentId。
ContentType
String
必填
送审类型,批量审核接口里,限制取值:Text/Image,音视频送审请参见 主动审核接口
Content
String
必填
送审内容,最大限制8KB,当审核文件时,填对应 URL。其中图片审核最大不超过5MB。
ExtSender
String
选填
发送方标识:可以置空,或填 Chat 对应的 UserID,也可以填业务自定义的发送方标识。填写后,内容理解控制台明细里可以过滤分析。
ExtReceiver
String
选填
接收方标识:可以置空,或填 Chat 对应的 UserID/GroupID,也可以填业务自定义接收方标识。填写后,内容理解控制台明细里可以过滤分析。

应答包体示例

{
"ActionStatus": "OK",
"ErrorCode": 0,
"ErrorInfo": "",
"AuditResults": [
{
"ErrorCode": 0,
"ErrorInfo": "",
"ContentId": 0,
"Result": "Block",
"Score": 99,
"Label": "Polity",
"SubLabel": "ChinesePresident",
"Keywords": [
"违&规&词&汇",
"违规词汇"
],
"RequestId": "c442f95e-35b9-47d7-8e01-3f9d644965fd"
},
{
"ErrorCode": 0,
"ErrorInfo": "",
"ContentId": 1,
"Result": "Pass",
"Score": 0,
"Label": "Normal",
"SubLabel": "",
"RequestId": "bf422ad2-cb2e-40cb-9b81-5936305c7b41"
},
{
"ErrorCode": 0,
"ErrorInfo": "",
"ContentId": 2,
"Result": "Block",
"Score": 97,
"Label": "Porn",
"SubLabel": "SexualBehavior",
"RequestId": "1ad85364-2bc1-454e-86bf-bbf1cc41fdff"
},
{
"ErrorCode": 0,
"ErrorInfo": "",
"ContentId": 3,
"Result": "Pass",
"Score": 0,
"Label": "Normal",
"SubLabel": "",
"RequestId": "ff7dad79-cb0c-4bea-aa99-1815b4de7591"
}
]
}

应答包字段说明

字段
类型
说明
ActionStatus
String
请求处理的结果:
OK:表示处理成功。
FAIL:表示失败。
ErrorCode
Integer
错误码:
0:表示成功。
非0:表示失败。
ErrorInfo
String
详细的错误信息。
AuditResults
Array
批量审核结果数组。
ContentId
Integer
内容 ID,同步请求里面的 ContentId。
RequestId
String
审核唯一标识。
Result
String
图文审核建议,Pass/Review/Block
Keywords
Array
违规时,命中的关键词,如果模型命中,则不会有关键词返回。
Score
Integer
图文审核恶意值,0-100,恶意程度与 Score 成正比。
Label
String
送审内容命中的标签 Normal/Polity/Porn/Illegal/Abuse/Terror/Ad/Sexy/Composite
SubLabel
String
命中的二级标签。

错误码说明

除非发生网络错误(例如502错误),否则该接口的 HTTP 返回码均为200。实际的错误码、错误信息是通过应答包体中的 ErrorCode 以及 ErrorInfo 来表示的。
公共错误码(60000到79999)请参见 错误码
本 API 私有错误码如下:
错误码
描述
60003
请求参数无效。
60020
未开启内容理解服务。
60022
请求内部错误,请联系我们。
93000
送审内容超过了最大限制8KB。
93001
请求内部错误,如果重试未恢复,请联系我们。
93005
批量审核接口只支持图文审核。
93006
批量审核接口,存在审核超时,超时时间为5s。
93007
批量审核接口,不支持重复的 ContentId。
93008
批量审核接口,一次最多支持10个 Content 送审。


Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback