Update Channel Video Moderation Settings (Requires Activation)
Updated: 2023-04-04 09:31:23
Interface Description
1、更新频道视频审核设置
2、(channelId, timestamp, appId)参与sign签名,并和sign一起通过url传递,请求体参数不参与签名,通过post请求体传递【请设置请求头contentType:application/json】
3、接口支持https协议
Interface URL
http://api.polyv.net/live/v4/channel/video-moderation/update
Request Method
POST
Interface Constraints
- The interface supports both HTTP and HTTPS. HTTPS is recommended to ensure interface security. Interface calls have frequency limits. See details
Request Parameter Description
| Parameter | Required | Type | Description |
|---|---|---|---|
| appId | true | String | Account appId [See Get Secret Key] |
| channelId | true | String | Channel ID |
| 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 saved or used directly on the client side. All APIs must be called through the customer's own server to relay requests to the POLYV server and retrieve response data. [See Signature Generation Rules] |
| timestamp | true | String | Current 13-digit millisecond timestamp, valid for 3 minutes |
Request Body Parameter Description
| Parameter | Required | Type | Description |
|---|---|---|---|
| channelId | true | Integer | Channel ID |
| moderationEnabled | true | String | Moderation switch, Y: Enable, N: Disable |
| illegalNotify | true | Object | [See IllegalNotify Parameter Description] |
| imageFrequency | true | Integer | Frame capture interval (5: Premium (12 reviews/min); 20: Enhanced (3 reviews/min); 60: Standard (1 review/min)) |
| moderationStrategy | true | String | Moderation strategy, finance_easy: Lenient, finance_normal: Normal, finance_serious: Strict |
IllegalNotify Parameter Description
| Parameter | Required | Type | Description |
|---|---|---|---|
| assistantEnabled | false | String | Assistant notification, Y: Enable, N: Disable, default N |
| monitorEnabled | false | String | Monitor notification, Y: Enable, N: Disable, default N |
| platformEnabled | false | String | Platform notification, Y: Enable, N: Disable, default N |
| talentEnabled | false | String | Host notification, Y: Enable, N: Disable, default N |
Example
http://api.polyv.net/live/v4/channel/video-moderation/update?appId=gga9dadhzm&sign=6AFE86666016B502E668174613B29585&channelId=3775168×tamp=1679623766123
Request body JSON parameters:
{
"illegalNotify": {
"platformEnabled": "Y",
"monitorEnabled": "Y",
"assistantEnabled": "Y",
"talentEnabled": "Y"
},
"imageFrequency": "60",
"moderationStrategy": "finance_serious",
"moderationEnabled": "Y"
}
Response Parameter Description
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Status code, same as HTTP status code, used to determine basic response status |
| data | Boolean | Successful response data |
| error | Object | Error information when status code is not 200 [See Error Parameter Description] |
| requestId | String | Request ID, a unique UUID generated for each request, only for troubleshooting and debugging, not to be tied to business logic |
| status | String | Response result, determined by business logic, returns success on success, error on failure |
| success | Boolean | Whether the response is 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 basic code, please download the relevant dependency source code. Click here to download the source code. After downloading, add it to your own source project. 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 functionality 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 videoModerationUpdateTest() 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/video-moderation/update";
String channelId = "3775168";
String moderationStrategy = "finance_serious";
String imageFrequency = "60";
String moderationEnabled = "Y";
String assistantEnabled = "Y";
String monitorEnabled = "Y";
String platformEnabled = "Y";
String talentEnabled = "Y";
//http 调用逻辑
Map<String, String> requestMap = new HashMap<>();
requestMap.put("appId", appId);
requestMap.put("timestamp", timestamp);
requestMap.put("channelId", channelId);
Map<String, Object> jsonMap = new HashMap<>();
jsonMap.put("imageFrequency", imageFrequency);
jsonMap.put("moderationEnabled", moderationEnabled);
jsonMap.put("moderationStrategy", moderationStrategy);
Map<String, Object> illegalNotifyMap = new HashMap<>();
jsonMap.put("illegalNotify", illegalNotifyMap);
illegalNotifyMap.put("assistantEnabled", assistantEnabled);
illegalNotifyMap.put("monitorEnabled", monitorEnabled);
illegalNotifyMap.put("platformEnabled", platformEnabled);
illegalNotifyMap.put("talentEnabled", talentEnabled);
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 error descriptions, see Global Error Description
Success Example
{
"code": 200,
"status": "success",
"requestId": "f0103b0961754d3a887f82e35032a6ea.69.16796237824386651",
"data": true,
"success": true
}
Error Example
{
"code": 400,
"status": "error",
"requestId": "d310b70bc329403f87f77f9203d50f89.128.16360831552223589",
"error": {
"code": 20001,
"desc": "application not found."
},
"success": false
}
