Polyv Help Center

Help Center

Modify Category Name

Updated: 2022-09-02 18:08:07

API Description

1、通过子账号修改视频分类名称
2、接口支持https协议

API URL

http://api.polyv.net/v3/category/update-info

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 Sub-account appId
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 Can be obtained via query category list
cateName true String Category name

Example

http://api.polyv.net/v3/category/update-info

Form parameters:

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&timestamp=1617933156904

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
error Object Returns null on success, returns error description on failure See error parameter description
requestId String Business request ID, must be unique for troubleshooting
data Object Returns null on both success and failure

Error Parameter Description

Field 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. 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(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

}

Response Example

For global system error descriptions, see Global Error Description

Success Example

{
  "requestId": "cef74869-726b-4e8c-a380-c7c3da86e8f7",
  "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 this category, insufficient permissions

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

Category ID does not exist

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