Delete Category
Updated: 2025-01-14 15:53:39
API Description
1、通过分类id,删除分类
2、接口URL中的{userid}为点播账号userid,具体参考菜单【使用须知】->【获取密钥】
3、接口支持https协议
4、每个账户预设根目录,名字为默认分类
API URL
http://api.polyv.net/v2/video/{userid}/deleteCata
Request Method
POST
API Constraints
- The API supports both HTTP and HTTPS. HTTPS is recommended to ensure security. API calls have frequency limits. See details
Request Parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
| ptime | true | Long | Current time in milliseconds, 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 on the client side for direct use. 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 |
| cataid | true | String | Video category ID, obtained from Get Categories and Subcategories |
Example
http://api.polyv.net/v2/video/1b448be323/deleteCata
Form parameters:
sign=440B448124E158662348FEC4A13A4F912982FBFD&cataid=1617164368991&ptime=1617168042648
Response Parameters
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Response status code, 200 for success, non-200 for failure See global error description |
| status | String | Response status text |
| message | String | Response description, provides error details when code is 400 or 500 |
| data | String | Returns true on success, empty string on error |
Java Request Example
For quick integration, please 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(VodVideoCategoryTest.class);
/**
* 删除分类
*/
@Test
public void testDeleteVideoCategory() 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/" + userId + "/deleteCata";
String cataId = "1617164368991";
Map<String, String> requestMap = new HashMap<>();
requestMap.put("ptime", ptime);
requestMap.put("cataid", cataId);
requestMap.put("sign", VodSignUtil.getSign(requestMap, secretKey));
String response = HttpUtil.postFormBody(url, requestMap);
log.debug("测试删除分类,{}", response);
//do somethings
}
Response Example
For global error descriptions, see Global Error Description
Success example
{
"code": 200,
"status": "success",
"message": "success",
"data": true
}
Error example
{
"code": 400,
"status": "error",
"message": "the sign is not right.",
"data": ""
}
