Polyv Help Center

Help Center

Delete Category

Updated: 2023-02-24 10:40:46

API Description

1、通过分类id删除视频信息
2、接口支持https协议

API URL

http://api.polyv.net/v3/category/delete

Online API Call

Request Method

POST

API Constraints

  1. 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 Account appId See details on obtaining keys
timestamp true Long Current time in milliseconds, valid within 3 minutes
sign true String Signature, 32-character uppercase MD5 value See MD5 signature generation rules
cateId true String Category ID Obtainable via query category list

Example

http://api.polyv.net/v3/category/delete

Form Parameters:

cateId=1618197697939&appId=a0Wmol5EwX&sign=93D4B0AE342CE8B52E9DF058D12F05F9&timestamp=1618197726044

Response Parameters

Parameter Type Description
requestId String Unique business request ID for troubleshooting
code Integer Response status code, 200 for success, non-200 for failure See global error description
status String Response status text
error Object Error information on failure, null on success See error field description
data Object Returns null on both success and failure

Error Field Description

Parameter Type Description
code Integer Error code
desc String Error description

Java Request Example

For quick integration, download the relevant dependency source code, click to download source code. Add it to your project after downloading. HttpUtil.java and VodSignUtil.java in the test cases are included in the download.

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(VodSubAccountTest.class);

/**
 * 删除分类
 */
@Test
public void testSubDeleteCategory() throws Exception, NoSuchAlgorithmException {
    //公共参数,填写自己的实际参数
    String secretKey = super.appSecret;//使用子账号的secretKey
    String appId = super.appId;
    String timestamp = String.valueOf(System.currentTimeMillis());
    //业务参数
    String url = "http://api.polyv.net/v3/category/delete";
    String cateId = "1618197697939";
    Map<String, String> requestMap = new HashMap<>();
    requestMap.put("appId", appId);
    requestMap.put("timestamp", timestamp);
    requestMap.put("cateId", cateId);

    //用md5进行签名
    requestMap.put("sign", VodSignUtil.getSignMd5(requestMap, secretKey));
    String response = HttpUtil.postFormBody(url, requestMap);
    log.debug("测试删除分类,{}", response);
    //do somethings
}

Response Example

See Global Error Description for system-wide error descriptions.

Success Example

{
    "requestId": "930bffa2-2731-4cf9-9e9f-323036019cd0",
    "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
}

Cannot operate on this category, insufficient permissions

{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 400,
    "status": "error",
    "error": {
        "code": 106,
        "desc": "category limited"
    },
    "data": null
}

Failed to delete category, reasons: invalid cataid, top-level category cannot be deleted

{
    "requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
    "code": 400,
    "status": "error",
    "error": {
        "code": 3004,
        "desc": "delete category failed"
    },
    "data": null
}
联系客服,在线咨询