Delete Video
Updated: 2022-09-02 18:08:07
API Description
1、通过视频id删除视频
2、接口支持https协议
API URL
http://api.polyv.net/v3/video/delete-video
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 Parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
| appId | true | String | POLYV VOD sub-account appId. Path: POLYV VOD backend -> Settings -> Account Management |
| timestamp | true | Long | Current time in milliseconds, valid for 3 minutes |
| sign | true | String | Signature, a 32-character uppercase MD5 value See MD5 Signature Generation Rules |
| vid | true | String | Video ID |
Example
http://api.polyv.net/v3/video/delete-video
Form Parameters:
vid=1b448be3233231b9b58172bc472341f5_1&appId=a0Wmol5EwX&sign=47418B9CF62580E006E651E737C1F4A6×tamp=1617876890595
Response Parameters
| Parameter | Type | Description |
|---|---|---|
| requestId | String | Unique business serial number for each request, used for troubleshooting on client/server side |
| code | Integer | Response status code. 200 indicates success, non-200 indicates failure See Global Error Description |
| status | String | Response status text |
| error | Object | Returns null on success, returns error description on failure See error parameter description |
| data | Object | Returns null on both success and failure |
error parameter description
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Error code |
| desc | String | Error description |
Java Request Example
For quick integration of basic code, please download the relevant dependency source code. Click to download source code. After downloading, add it to your own source project. HttpUtil.java and VodSignUtil.java in the test cases are included in the download 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(VodSubAccountTest.class);
/**
* 删除视频
* @throws Exception
* @throws NoSuchAlgorithmException
*/
@Test
public void testSubDeleteVideo() throws Exception, NoSuchAlgorithmException {
//公共参数,填写自己的实际参数
String appId = super.appId;
String appSecret = super.appSecret;
String timestamp = String.valueOf(System.currentTimeMillis());
//业务参数
String url = "http://api.polyv.net/v3/video/delete-video";
String vid = "1b448be3233231b9b58172bc472341f5_1";
Map<String, String> requestMap = new HashMap<>();
requestMap.put("appId", appId);
requestMap.put("timestamp", timestamp);
requestMap.put("vid", vid);
requestMap.put("sign", VodSignUtil.getSignMd5(requestMap, appSecret));
String response = HttpUtil.postFormBody(url, requestMap);
log.debug("测试删除视频,{}", response);
//do somethings
}
Response Example
For global system error descriptions, see Global Error Description
Success Example
{
"requestId":"6729d5a4-1318-46c0-9978-5fe6dce5ffe9",
"code":200,
"status":"success",
"error":null,
"data":null
}
Error Example
Timestamp Error
{
"requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
"code": 400,
"status": "error",
"error": {
"code": 100,
"desc": "invalid timestamp"
},
"data": null
}
Incorrect appId
{
"requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
"code": 400,
"status": "error",
"error": {
"code": 101,
"desc": "application not exist"
},
"data": null
}
Sub-account Does Not Exist
{
"requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
"code": 400,
"status": "error",
"error": {
"code": 102,
"desc": "user children not exist"
},
"data": null
}
Sub-account Expired
{
"requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
"code": 403,
"status": "error",
"error": {
"code": 103,
"desc": "user children expired"
},
"data": null
}
Signature Error
{
"requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
"code": 403,
"status": "error",
"error": {
"code": 104,
"desc": "invalid signature"
},
"data": null
}
Insufficient Account Permissions
{
"requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
"code": 403,
"status": "error",
"error": {
"code": 105,
"desc": "permission limited"
},
"data": null
}
Incorrect Video ID
{
"requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
"code": 400,
"status": "error",
"error": {
"code": 2000,
"desc": "invalid vid"
},
"data": null
}
