Polyv Help Center

Help Center

Delete Q&A Questions

Updated: 2022-09-02 18:08:07

API Description

1、通过视频id删除单个视频的问答题目
2、接口支持https协议

API URL

http://api.polyv.net/v2/video/delete-video-exam

Online API Call

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
userid true String POLYV VOD account ID. Refer to Get Secret Key for acquisition. Path: Official website -> Login -> VOD (API Interface)
ptime true Long Current time in milliseconds timestamp, valid within 3 minutes
sign true String Signature, a 40-character uppercase SHA1 value. The secretkey used to generate the signature is critical for communication data security. It must not be stored 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 for response data. See signature generation rules
vid true String Video ID
examIds false String Q&A IDs, separated by commas. If not provided, all Q&A questions for the video will be deleted

Example

http://api.polyv.net/v2/video/delete-video-exam

Form Parameters:

vid=1b448be3232194b94346000156cb568d_1&sign=9000B0170801F38B80B5AE21A8BB64B5DADC3691&userid=1b448be323&ptime=1620616838272&examIds=1794068293a

Response Parameter Description

Parameter Type Description
code Integer Response status code. 200 indicates success, non-200 indicates failure. See global error description
status String Response status text
message String Response description. When code is 400 or 500, provides auxiliary error reason

Java Request Example

For quick integration of basic code, download the relevant dependency source code. Click to download source code. After downloading, add it to your own source project. The test cases include HttpUtil.java and VodSignUtil.java in the downloaded file.

It is strongly recommended to use the VOD Java SDK for API integration. The VOD 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(VodVideoManageManagementTest.class);
/**
 * 删除问答题目
 */
@Test
public void testDeleteQuiz() throws Exception, NoSuchAlgorithmException {
    //公共参数,填写自己的实际参数
    String secretKey = super.secretKey;
    String userId = super.userId;
    String ptime = String.valueOf(System.currentTimeMillis());
    //业务参数
    String url = "http://api.polyv.net/v2/video/delete-video-exam";
    String vid = "1b448be3232194b94346000156cb568d_1";
    String examIds = "1794068293a";

    //调用参数
    Map<String, String> requestMap = new HashMap<>();
    requestMap.put("userid", userId);
    requestMap.put("ptime", ptime);
    requestMap.put("vid", vid);
    requestMap.put("examIds", examIds);
    requestMap.put("sign", VodSignUtil.getSign(requestMap, secretKey));
    String response = HttpUtil.postFormBody(url, requestMap);
    log.debug("测试删除问答题目,{}", response);
    //do somethings
}

Response Example

For global system error descriptions, see Global Error Description

Success Example

{
    "code":200,
    "status":"success",
    "message":"success"
}

Error Example

Incorrect Signature

{
"code":400,
"status":"error",
"message":"the sign is not right",
"data":""
}

Timestamp Expired

{
"code":400,
"status":"error",
"message":"ptime is too old.",
"data":""
}

Invalid Video

{
    "code": 400,
    "status": "error",
    "message": "Illegal vid",
    "data": ""
}

Invalid Parameter Value

{
    "code": 400,
    "status": "error",
    "message": "Illegal param: 'xxx' for value: 'xxx'",
    "data": null
}
联系客服,在线咨询