查询频道音频审核设置(需开通)
更新时间:2026-06-26 16:04:48
接口描述
1、查询频道音频审核设置
2、接口支持https协议
3、按账号开通版本返回配置:账号 audioModerationFunctionEnable 为 Y(金融版)或 AI(大模型版)即视为已开通音频审核;未开通(N、空或其他值)返回错误码 1041。返回对象为合并结构,金融版与大模型版字段同时返回,调用方按账号版本取用即可
接口URL
http://api.polyv.net/live/v4/channel/audio-moderation/get
请求方式
GET
接口约束
1、接口同时支持HTTP 、HTTPS ,建议使用HTTPS 确保接口安全,接口调用有频率限制,详细请查看
请求参数描述
| 参数名 | 必选 | 类型 | 说明 |
|---|---|---|---|
| appId | true | String | 账号appId【详见获取密钥】 |
| channelId | true | String | 频道ID |
| sign | true | String | 签名,为32位大写的MD5值,生成签名的appSecret密钥作为通信数据安全的关键信息,严禁保存在客户端直接使用,所有API都必须通过客户自己服务器中转调用POLYV服务器获取响应数据【详见签名生成规则】 |
| timestamp | true | String | 当前13位毫秒级时间戳,3分钟内有效 |
示例
http://api.polyv.net/live/v4/channel/audio-moderation/get?appId=gga8efhn0h&sign=A172F9012D17020EEB0BF343492FB26D&channelId=3791474×tamp=1678087256825
响应参数描述
| 参数名 | 类型 | 说明 |
|---|---|---|
| code | Integer | 状态码,与 http 状态码相同,用于确定基本的响应状态 |
| data | Object | 【详见Data参数描述】 |
| error | Object | 状态码非200时的错误信息【详见Error参数描述】 |
| requestId | String | 请求ID,每次请求生成的唯一的 UUID,仅可用于排查、调试,不应该和业务挂上钩 |
| status | String | 响应结果,由业务决定,成功返回success,失败返回error |
| success | Boolean | 是否成功响应 |
Data参数描述
| 参数名 | 类型 | 说明 |
|---|---|---|
| badwordEnabled | String | 应用严禁词开关,Y/N |
| channelId | Integer | 频道id |
| customRule | String | 自定义审核规则(大模型版,llmAuditEnabled=Y 时作为审核规则生效) |
| illegalNotify | Object | 违规提醒配置【详见IllegalNotify参数描述】 |
| llmAuditEnabled | String | 大模型审核开关,Y/N(大模型版) |
| moderationEnabled | String | 审核开关,Y/N |
| moderationStrategy | String | 审核策略(金融版) easy:宽松审核策略 normal:一般审核策略 strict:严格审核策略 |
| userId | String | POLYV用户ID,和保利威官网一致,获取路径:官网->登录->直播(开发设置) |
返回为合并结构:金融版账号会一并返回大模型版字段(llmAuditEnabled、customRule、illegalNotify.notifyLevel 等,可能为空),大模型版账号会一并返回 moderationStrategy(默认 easy,不参与大模型版审核)。调用方按账号开通版本取用对应字段即可。
IllegalNotify参数描述
| 参数名 | 类型 | 说明 |
|---|---|---|
| assistantEnabled | String | 助理提醒,Y/N |
| monitorEnabled | String | 监播提醒,Y/N |
| notifyLevel | String | 接收提醒等级(大模型版) all:所有风险项 medium_plus:中风险及以上 high_only:仅高风险项 |
| notifyUrl | String | 对外提醒URL(大模型版);为空表示对外提醒未开启,有值时违规事件会推送到该URL |
| platformEnabled | String | 平台通知,Y/N |
| talentEnabled | String | 主播提醒,Y/N |
Error参数描述
| 参数名 | 类型 | 说明 |
|---|---|---|
| code | Integer | 错误代码,用于确定具体的错误原因 |
| desc | String | 错误描述,与 error.code 对应 |
Java请求示例
快速接入基础代码请下载相关依赖源码, 点击下载源代码 ,下载后加入到自己的源码工程中即可。测试用例中的HttpUtil.java 和 LiveSignUtil.java 都包含在下载文件中。
强烈建议您使用直播Java SDK完成API的功能对接,直播Java SDK 对API调用逻辑、异常处理、数据签名、HTTP请求线程池进行了统一封装和优化。
private static final Logger log = LoggerFactory.getLogger(getClass());
/**
* 查询频道音频审核设置
* @throws IOException
* @throws NoSuchAlgorithmException
*/
@Test
public void audioModerationGetTest() throws IOException, NoSuchAlgorithmException {
//公共参数,填写自己的实际参数
String appId = super.appId;
String appSecret = super.appSecret;
String timestamp = String.valueOf(System.currentTimeMillis());
//业务参数
String url = "http://api.polyv.net/live/v4/channel/audio-moderation/get";
String channelId = "";
//http 调用逻辑
Map<String, String> requestMap = new HashMap<>();
requestMap.put("appId", appId);
requestMap.put("channelId", channelId);
requestMap.put("timestamp", timestamp);
requestMap.put("sign", LiveSignUtil.getSign(requestMap, appSecret));
String response = HttpUtil.get(url, requestMap);
log.info("测试查询频道音频审核设置成功:{}", response);
//do somethings
}
响应示例
系统全局错误说明详见全局错误说明
金融版成功示例
{
"code": 200,
"status": "success",
"requestId": "414afeb28f1c4f0ca17e1c3c1e39d247.10285.16780871639086817",
"data": {
"userId": "4bcae48f78",
"channelId": 3791474,
"moderationEnabled": "Y",
"moderationStrategy": "normal",
"badwordEnabled": "N",
"llmAuditEnabled": "N",
"customRule": "",
"illegalNotify": {
"monitorEnabled": "Y",
"talentEnabled": "Y",
"assistantEnabled": "Y",
"platformEnabled": "Y"
}
},
"success": true
}
大模型版成功示例
{
"code": 200,
"status": "success",
"requestId": "414afeb28f1c4f0ca17e1c3c1e39d247.10285.16780871639086817",
"data": {
"userId": "4bcae48f78",
"channelId": 3791474,
"moderationEnabled": "Y",
"moderationStrategy": "easy",
"badwordEnabled": "Y",
"llmAuditEnabled": "Y",
"customRule": "禁止主播引导观众添加微信、QQ等社交账号进行私下交易;禁止主播在直播中提及其他竞品平台名称;禁止主播使用攻击性语言。",
"illegalNotify": {
"monitorEnabled": "Y",
"talentEnabled": "N",
"assistantEnabled": "Y",
"platformEnabled": "N",
"notifyUrl": "https://example.com/audio-moderation/callback",
"notifyLevel": "medium_plus"
}
},
"success": true
}
异常示例
{
"code": 400,
"status": "error",
"requestId": "d310b70bc329403f87f77f9203d50f89.128.16360831552223589",
"error": {
"code": 20001,
"desc": "application not found."
},
"success": false
}
账号未开通音频审核(audioModerationFunctionEnable 为 N、空或其他值),返回错误码 1041
{
"code": 400,
"status": "error",
"requestId": "d310b70bc329403f87f77f9203d50f89.128.16360831552223589",
"error": {
"code": 1041,
"desc": "账号未开启音频审核功能"
},
"success": false
}
