Modify Category Name
Updated: 2025-01-14 15:52:02
API Description
1、通过分类id,修改分类的名称
2、接口URL中的{userid}为点播账号userid,具体参考菜单【使用须知】->【获取密钥】
3、接口支持https协议
4、每个账户预设根目录,名字为默认分类
API URL
http://api.polyv.net/v2/video/{userid}/updateCata
Request Method
POST
API Constraints
- The API supports both HTTP and HTTPS. HTTPS is recommended to ensure interface security. API calls have frequency limits. See details
Request Parameter Description
| Parameter | Required | Type | Description |
|---|---|---|---|
| ptime | true | Long | Current time in milliseconds timestamp, 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 directly on the client. 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 |
| cataname | true | String | Modified category name |
| cataid | true | String | Video category ID. This parameter is obtained from Get Categories and Subcategories |
Example
http://api.polyv.net/v2/video/1b448be323/updateCata
Form Parameters:
sign=C07BB6415AFA10348DD5DDBA1D041BA6F9C5FC53&cataid=1617160372987&cataname=修改后的分类名&ptime=1617234104656
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, provides additional error details |
| data | String | Returns true on success, empty string on error |
Java Request Example
For quick integration of basic code, please download the relevant dependency source code. Click here 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 testUpdateVideoCategoryName() 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 + "/updateCata";
String cataId = "1617160372987";
String cataName = "修改后的分类名";
Map<String, String> requestMap = new HashMap<>();
requestMap.put("ptime", ptime);
requestMap.put("cataid", cataId);
requestMap.put("cataname", cataName);
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": ""
}
