Polyv Help Center

Help Center

Modify Default Template Video Moderation

Updated: 2023-12-11 09:38:34

API Description

1、修改视频审核默认模板设置
2、接口支持https协议

API URL

http://api.polyv.net/live/v4/user/template/video-moderation/update

Request Method

POST

API Constraints

  1. The API supports both HTTP and HTTPS. HTTPS is recommended for security. API calls are subject to rate 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 the customer's own server to relay requests to the POLYV server for 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
moderationEnabled true String Moderation switch
Y: Enable
N: Disable
moderationStrategy true String Moderation strategy (finance_easy: Lenient, finance_normal: Moderate, finance_serious: Strict)
imageFrequency true Integer Frame capture interval (5s, 20s, 60s)
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&timestamp=1677167340447

Request body JSON parameters:

{
    "moderationEnabled": "N",
    "moderationStrategy": "finance_serious",
    "imageFrequency": 5,
    "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 the basic response status
data Object Data for a successful response
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, for debugging and troubleshooting only, not for business logic
status String Response result, determined by business logic. Returns success on success, error on failure
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 code 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 updateVideoModerationSettingTemplateTest() 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 imageFrequency = 5;
    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("imageFrequency", imageFrequency);
    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
}
联系客服,在线咨询