刪除影片
更新時間:2022-09-02 18:08:07
介面說明
1、通过视频id删除视频
2、接口支持https协议
介面URL
http://api.polyv.net/v3/video/delete-video
請求方式
POST
介面限制
1、介面同時支援HTTP、HTTPS,建議使用HTTPS以確保介面安全,介面呼叫有頻率限制,詳細請查看
請求參數說明
| 參數名 | 必填 | 類型 | 說明 |
|---|---|---|---|
| appId | true | String | 保利威點播子帳戶appId,取得路徑:保利威點播後台->設定->帳號管理 |
| timestamp | true | Long | 目前時間的毫秒級時間戳,3分鐘內有效 |
| sign | true | String | 簽名,為32位大寫的MD5值【詳見MD5簽名生成規則】 |
| vid | true | String | 影片id |
範例
http://api.polyv.net/v3/video/delete-video
表單參數:
vid=1b448be3233231b9b58172bc472341f5_1&appId=a0Wmol5EwX&sign=47418B9CF62580E006E651E737C1F4A6×tamp=1617876890595
回應參數說明
| 參數名 | 類型 | 說明 |
|---|---|---|
| requestId | String | 每次請求的業務流水號,必須唯一,便於客戶端/伺服器端排查問題 |
| code | Integer | 回應狀態碼,200為成功返回,非200為失敗【詳見全域錯誤說明】 |
| status | String | 回應狀態文字資訊 |
| error | Object | 回應成功返回null,回應失敗返回錯誤描述資訊【詳見error參數說明】 |
| data | Object | 回應成功或失敗都返回null |
error參數說明
| 參數名 | 類型 | 說明 |
|---|---|---|
| code | Integer | 錯誤碼 |
| desc | String | 錯誤描述 |
Java請求範例
快速接入基礎代碼請下載相關依賴原始碼, 點擊下載原始碼 ,下載後加入到自己的原始碼工程中即可。測試用例中的HttpUtil.java 和 VodSignUtil.java 都包含在下載檔案中。
強烈建議您使用點播Java SDK完成API的功能對接,點播Java SDK 對API呼叫邏輯、異常處理、資料簽名、HTTP請求執行緒池進行了統一封裝和最佳化。
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
}
回應範例
系統全域錯誤說明詳見全域錯誤說明
成功範例
{
"requestId":"6729d5a4-1318-46c0-9978-5fe6dce5ffe9",
"code":200,
"status":"success",
"error":null,
"data":null
}
異常範例
時間戳錯誤
{
"requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
"code": 400,
"status": "error",
"error": {
"code": 100,
"desc": "invalid timestamp"
},
"data": null
}
appId不正確
{
"requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
"code": 400,
"status": "error",
"error": {
"code": 101,
"desc": "application not exist"
},
"data": null
}
子帳號不存在
{
"requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
"code": 400,
"status": "error",
"error": {
"code": 102,
"desc": "user children not exist"
},
"data": null
}
子帳號過期
{
"requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
"code": 403,
"status": "error",
"error": {
"code": 103,
"desc": "user children expired"
},
"data": null
}
簽名錯誤
{
"requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
"code": 403,
"status": "error",
"error": {
"code": 104,
"desc": "invalid signature"
},
"data": null
}
帳號權限不足
{
"requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
"code": 403,
"status": "error",
"error": {
"code": 105,
"desc": "permission limited"
},
"data": null
}
影片id錯誤
{
"requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
"code": 400,
"status": "error",
"error": {
"code": 2000,
"desc": "invalid vid"
},
"data": null
}
