Delete Video Sync Task
Updated: 2025-01-14 15:46:22
API Description
1、通过任务id删除视频同步任务
2、接口URL中的{userid}为点播账号userid,具体参考菜单【使用须知】->【获取密钥】
3、接口支持https协议
API URL
http://api.polyv.net/v2/video/grab/{userid}/delete
Request Method
POST
API Constraints
- The API supports both HTTP and HTTPS. HTTPS is recommended for security. API calls have frequency limits. Click for details
Request Parameter Description
| Parameter | Required | Type | Description |
|---|---|---|---|
| ptime | true | Long | Current time in milliseconds, valid for 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 |
| taskId | true | String | Sync task ID. taskId can be obtained via Query Video Sync Task |
Example
http://api.polyv.net/v2/video/grab/1b448be323/delete
Form Parameters:
sign=2439082F25E1A9F708EB842A9BA7626AC72A1983&ptime=1617095444385&taskId=j9vqh7TlJM
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, it provides additional error details |
| data | String | Returns "Success" on success, empty on failure |
Java Request Example
For quick integration, download the relevant dependency source code. Click to download source code. After downloading, add it to your project. The test cases include HttpUtil.java and VodSignUtil.java in the downloaded package.
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 pooling.
private static final Logger log = LoggerFactory.getLogger(VodVideoUploadTest.class);
/**
* 删除视频同步任务
* @throws Exception
* @throws NoSuchAlgorithmException
*/
@Test
public void testDeleteVideoTask() throws Exception, NoSuchAlgorithmException {
//公共参数,填写自己的实际参数
String secretKey = super.secretKey;
String userId = super.userId;
String ptime = String.valueOf(System.currentTimeMillis());
//业务参数
String url = String.format("http://api.polyv.net/v2/video/grab/%s/delete", userId);
String taskId = "j9vqh7TlJM";
Map<String, String> requestMap = new HashMap<>();
requestMap.put("ptime", ptime);
requestMap.put("taskId", taskId);
requestMap.put("sign", VodSignUtil.getSign(requestMap, secretKey));
String response = HttpUtil.postFormBody(url, requestMap);
log.debug("测试删除视频同步任务,{}", response);
//do somethings
}
Response Example
For system-wide global error descriptions, see Global Error Description
Success Example
{
"code": 200,
"status": "success",
"message": "",
"data": "成功"
}
Error Example
{
"code":400,
"status":"error",
"message":"TaskId is null!",
"data":""
}
