1、修改音频审核默认模板设置
2、接口支持https协议
http://api.polyv.net/live/v4/user/template/audio-moderation/update
http://api.polyv.net/live/v4/user/template/video-moderation/update?appId=frlr1zazn3&sign=9C73C7471CF969AD8AC042221C89551D×tamp=1677167340447
{
"moderationEnabled": "N",
"moderationStrategy": "finance_serious",
"badwordEnabled": "N",
"illegalNotify": {
"monitorEnabled": "Y",
"talentEnabled": "Y",
"assistantEnabled": "Y",
"platformEnabled": "Y"
}
}
强烈建议您使用直播Java SDK完成API的功能对接,直播Java SDK 对API调用逻辑、异常处理、数据签名、HTTP请求线程池进行了统一封装和优化。
private static final Logger log = LoggerFactory.getLogger(getClass());
/**
* 修改音频审核默认模板设置
* @throws IOException
* @throws NoSuchAlgorithmException
*/
@Test
public void updateAudioModerationSettingTemplateTest() 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/user/template/video-moderation/update";
String moderationEnabled = "Y";
String moderationStrategy = "finance_serious";
String badwordEnabled = "Y";
IllegalNotify illegalNotify = new IllegalNotify();
illegalNotify.monitorEnabled = "Y";
illegalNotify.talentEnabled = "Y";
illegalNotify.assistantEnabled = "Y";
illegalNotify.platformEnabled = "Y";
//http 调用逻辑
Map<String, String> requestMap = new HashMap<>();
requestMap.put("appId", appId);
requestMap.put("timestamp", timestamp);
Map<String, Object> jsonMap = new HashMap<>();
jsonMap.put("moderationEnabled", moderationEnabled);
jsonMap.put("moderationStrategy", moderationStrategy);
jsonMap.put("badwordEnabled", badwordEnabled);
jsonMap.put("illegalNotify", illegalNotify);
requestMap.put("sign", LiveSignUtil.getSign(requestMap, appSecret));
url = HttpUtil.appendUrl(url, requestMap);
String response = HttpUtil.postJsonBody(url, JSON.toJSONString(jsonMap), null);
log.info("测试修改音频审核默认模板设置成功:{}", response);
//do somethings
}
{
"code": 200,
"status": "success",
"requestId": "a5e9b1d15f544d7a9db6f038156a851d.71.16771673423081591",
"data": null,
"success": true
}
{
"code": 400,
"status": "error",
"requestId": "d310b70bc329403f87f77f9203d50f89.128.16360831552223589",
"error": {
"code": 20001,
"desc": "application not found."
},
"success": false
}