修改分類名稱
更新時間:2022-09-02 18:08:07
介面描述
1、通过子账号修改视频分类名称
2、接口支持https协议
介面URL
http://api.polyv.net/v3/category/update-info
請求方式
POST
介面限制
1、介面同時支援HTTP及HTTPS,建議使用HTTPS確保介面安全,介面呼叫有頻率限制,詳細請查看
請求參數描述
| 參數名 | 必選 | 類型 | 說明 |
|---|---|---|---|
| appId | true | String | 子帳號appId |
| timestamp | true | Long | 當前時間的毫秒級時間戳,3分鐘內有效 |
| sign | true | String | 簽名,32位大寫MD5值【詳見MD5簽名生成規則】 |
| cateId | true | String | 分類id【可透過查詢分類列表取得】 |
| cateName | true | String | 分類名稱 |
範例
http://api.polyv.net/v3/category/update-info
表單參數:
cateId=1617850556356&appId=xxxxxx&sign=7563248035D220957B1DE087815D25D3&cateName=%E6%B5%8B%E8%AF%95%E4%BF%AE%E6%94%B9%E5%88%86%E7%B1%BB%E5%90%8D%E7%A7%B0×tamp=1617933156904
回應參數描述
| 參數名 | 類型 | 說明 |
|---|---|---|
| code | Integer | 回應狀態碼,200為成功返回,非200為失敗【詳見全域錯誤說明】 |
| status | String | 回應狀態文字資訊 |
| error | Object | 回應成功返回null,回應失敗返回錯誤描述資訊【詳見error參數描述】 |
| requestId | String | 每次請求的業務流水號,必須唯一,便於客戶端/伺服器端排查問題 |
| 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 testSubModifyCategoryName() throws Exception, NoSuchAlgorithmException {
//公共参数,填写自己的实际参数
String appId = super.appId;
String appSecret = super.appSecret;
String timestamp = String.valueOf(System.currentTimeMillis());
//业务参数
String url = "http://api.polyv.net/v3/category/update-info";
String cateId = "1617850556356";
String cateName = "测试修改分类名称";
Map<String, String> requestMap = new HashMap<>();
requestMap.put("appId", appId);
requestMap.put("timestamp", timestamp);
requestMap.put("cateId", cateId);
requestMap.put("cateName", cateName);
requestMap.put("sign", VodSignUtil.getSignMd5(requestMap, appSecret));
String response = HttpUtil.postFormBody(url, requestMap);
log.debug("测试修改分类名称,{}", response);
//do somethings
}
回應範例
系統全域錯誤說明詳見全域錯誤說明
成功範例
{
"requestId": "cef74869-726b-4e8c-a380-c7c3da86e8f7",
"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
}
無法操作此分類,權限不足
{
"requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
"code": 400,
"status": "error",
"error": {
"code": 106,
"desc": "category limited"
},
"data": null
}
分類id不存在
{
"requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
"code": 400,
"status": "error",
"error": {
"code": 3001,
"desc": "category not exist"
},
"data": null
}
