Polyv Help Center

Help Center

Move Category

Updated: 2025-01-14 15:53:11

Interface Description

1、通过分类id,移动分类的位置
2、接口URL中的{userid}为点播账号userid,具体参考菜单【使用须知】->【获取密钥】
3、接口支持https协议
4、每个账户预设根目录,名字为默认分类

Interface URL

http://api.polyv.net/v2/cata/{userid}/change

Online API Call

Request Method

POST

Interface Constraints

  1. The interface supports both HTTP and HTTPS. HTTPS is recommended to ensure interface security. Interface calls are subject to frequency limits. See details

Request Parameter Description

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 never be saved or used directly on the client side. All APIs must be relayed through the customer's own server to call the POLYV server for response data. See signature generation rules
cataid true String The category ID to be moved. ID 1 represents the default category. This parameter is obtained from Get Categories and Subcategories
destCataid true String The destination category ID to move to. ID 1 represents the default category. This parameter is obtained from Get Categories and Subcategories

Example

http://api.polyv.net/v2/cata/1b448be323/change

Form Parameters:

destCataid=1&sign=D9E1DD7A2165CEC5BD68BBBD03C3C92CE8B8B6A1&cataid=1617173363572&ptime=1617241392823

Response Parameter Description

Parameter Type Description
code Integer Response status code. 200 indicates success, non-200 indicates failure. See global error description
status String Response status text
message String Response description. When code is 400 or 500, it provides additional error details.
data String Returns true on success, returns an empty string on error.

Java Request Example

For quick integration of the basic code, download the relevant dependency source code. Click here to download the source code. After downloading, add it to your own source code project. The HttpUtil.java and VodSignUtil.java in the test cases are included 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 pooling.


private static final Logger log = LoggerFactory.getLogger(VodVideoCategoryTest.class);

/**
 * 移动分类
 */
@Test
public void testMoveVideoCategory() throws Exception, NoSuchAlgorithmException {
        //公共参数,填写自己的实际参数
        String secretKey = super.secretKey;
        String userId = super.userId;
        String ptime = String.valueOf(System.currentTimeMillis());
        //业务参数
        String url = "http://api.polyv.net/v2/cata/" + userId + "/change";
        String cataId = "1617173363572";
        String destCataId = "1";

        Map<String, String> requestMap = new HashMap<>();
        requestMap.put("ptime", ptime);
        requestMap.put("cataid", cataId);
        requestMap.put("destCataid", destCataId);
        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": "sign can not be empty.",
  "data": ""
}
联系客服,在线咨询
在线咨询