Modify Default Template Audio Moderation
Updated: 2023-12-11 09:49:43
API Description
1、修改音频审核默认模板设置
2、接口支持https协议
API URL
http://api.polyv.net/live/v4/user/template/audio-moderation/update
Request Method
POST
API Constraints
- The API supports both HTTP and HTTPS. HTTPS is recommended for security. API calls have frequency limits. See details
Request Parameter Description
| Parameter | Required | Type | Description |
|---|---|---|---|
| appId | true | String | Account appId See Get Secret Key |
| sign | true | String | Signature, a 32-character uppercase MD5 value. The appSecret key used to generate the signature is critical for communication data security. It must never be used directly on the client side. All APIs must be called through your own server to relay requests to the POLYV server. See Signature Generation Rules |
| timestamp | true | String | Current 13-digit millisecond timestamp, valid for 3 minutes |
Request Body Parameter Description
| Parameter | Required | Type | Description |
|---|---|---|---|
| moderationEnabled | true | String | Moderation switch Y: Enable N: Disable |
| moderationStrategy | true | String | Moderation strategy (easy, normal, strict) |
| badwordEnabled | true | String | Banned words switch Y: Enable N: Disable |
| illegalNotify | true | Object | Violation notification settings |
illegalNotify Parameter Description
| Parameter | Type | Description |
|---|---|---|
| monitorEnabled | String | Switch Y: Enable N: Disable |
| talentEnabled | String | Switch Y: Enable N: Disable |
| assistantEnabled | String | Switch Y: Enable N: Disable |
| platformEnabled | String | Switch Y: Enable N: Disable |
Example
http://api.polyv.net/live/v4/user/template/video-moderation/update?appId=frlr1zazn3&sign=9C73C7471CF969AD8AC042221C89551D×tamp=1677167340447
Request body JSON parameters:
{
"moderationEnabled": "N",
"moderationStrategy": "finance_serious",
"badwordEnabled": "N",
"illegalNotify": {
"monitorEnabled": "Y",
"talentEnabled": "Y",
"assistantEnabled": "Y",
"platformEnabled": "Y"
}
}
Response Parameter Description
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Status code, same as HTTP status code, used to determine basic response status |
| data | Object | Data on successful response |
| error | Object | Error information when status code is not 200 See Error Parameter Description |
| requestId | String | Request ID, a unique UUID generated per request, for debugging only, not for business logic |
| status | String | Response result, determined by business logic: success returns success, failure returns error |
| success | Boolean | Whether the response was successful |
Error Parameter Description
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Error code, used to identify the specific error cause |
| desc | String | Error description, corresponding to error.code |
Java Request Example
For quick integration of the base code, please download the relevant dependency source code. Click here to download the source code. After downloading, add it to your own source project. The HttpUtil.java and LiveSignUtil.java in the test cases are included in the downloaded file.
It is strongly recommended to use the Live Java SDK for API integration. The Live Java SDK provides unified encapsulation and optimization for API call logic, exception handling, data signing, and HTTP request thread pools.
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
}
Response Example
For global system error descriptions, see Global Error Description
Success Example
{
"code": 200,
"status": "success",
"requestId": "a5e9b1d15f544d7a9db6f038156a851d.71.16771673423081591",
"data": null,
"success": true
}
Error Example
{
"code": 400,
"status": "error",
"requestId": "d310b70bc329403f87f77f9203d50f89.128.16360831552223589",
"error": {
"code": 20001,
"desc": "application not found."
},
"success": false
}
