接口描述
1、通过分类id修改视频分类属性设置
2、接口支持https协议
接口URL
http://api.polyv.net/v3/category/update-profile
在线API调用
请求方式
接口约束
1、接口同时支持HTTP 、HTTPS ,建议使用HTTPS 确保接口安全,接口调用有频率限制,详细请查看
2、userId参与签名,并和sign一起通过url传递
请求参数描述
保利威点播账户id,可以参考【获取密钥】获取,获取路径:官网->登录->点播(API接口)
是否启用分类设置,默认为N:关闭
关闭时,该分类的属性设置默认跟随账号视频属性设置。启用后,可对该分类的属性做单独的设置
Y:启用
N:关闭
源文件播放设置开关(仅对新上传视频有效),默认值为0:非源文件播放
如果为源文件播放,encrypt、encryptLevel、isEdu、encodeAAC参数不生效
1:开启
0:关闭
视频加密设置开关(仅对新上传视频有效),默认值为0:关闭
1:开启
0:关闭
加密等级(仅对新上传视频有效),默认值为open:非加密授权
open:非加密授权
web:WEB授权
app:APP授权
wxa_app:小程序授权
视频优化(仅对新上传视频有效),默认值为0:关闭
1:开启
0:关闭
生成音频文件(仅对新上传视频有效),默认为0:关闭
该功能只对部分有权限用户开放
1:开启
0:关闭
示例
http://api.polyv.net/v3/category/update-profile
表单参数:
isEdu=1&encode_aac=1&cateId=1617877139774&encrypt=1&appId=a0Wmol5EwX&keepSource=0&sign=05AF8FB0336F152D9140DB92A94B80F1&encryptLevel=web&userId=1b448be323&enabled=Y×tamp=1617933240089
响应参数描述
每次请求的业务流水号,必须唯一,便于客户端/服务器端排查问题
响应状态码,200为成功返回,非200为失败【详见全局错误说明】
error字段说明
Java请求示例
快速接入基础代码请下载相关依赖源码, 点击下载源代码 ,下载后加入到自己的源码工程中即可。测试用例中的HttpUtil.java 和 VodSignUtil.java 都包含在下载文件中。
强烈建议您使用点播Java SDK完成API的功能对接,点播Java SDK 对API调用逻辑、异常处理、数据签名、HTTP请求线程池进行了统一封装和优化。
private static final Logger log = LoggerFactory.getLogger(VodSubAccountTest.class);
/**
* 修改分类设置
*/
@Test
public void testSubModifyCategorySetting() throws Exception, NoSuchAlgorithmException {
//公共参数,填写自己的实际参数
String secretKey = super.appSecret;//使用子账号的secretKey
String userid = super.userId;
String timestamp = String.valueOf(System.currentTimeMillis());
//业务参数
String url = "http://api.polyv.net/v3/category/update-profile";
String appId = super.appId;
String cateId = "1617877139774";
String enabled = "Y";
String keepSource = "0";
String encrypt = "1";
String encryptLevel = "web";
String isEdu = "1";
String encode_aac = "1";
Map<String, String> requestMap = new HashMap<>();
requestMap.put("userId", userid);
requestMap.put("appId", appId);
requestMap.put("timestamp", timestamp);
requestMap.put("cateId", cateId);
requestMap.put("enabled", enabled);
requestMap.put("keepSource", keepSource);
requestMap.put("encrypt", encrypt);
requestMap.put("encryptLevel", encryptLevel);
requestMap.put("isEdu", isEdu);
requestMap.put("encode_aac", encode_aac);
//用md5进行签名
requestMap.put("sign", VodSignUtil.getSignMd5(requestMap, secretKey));
String response = HttpUtil.postFormBody(url, requestMap);
log.debug("测试修改分类设置,{}", response);
//do somethings
}
响应示例
系统全局错误说明详见全局错误说明
成功示例
{
"requestId": "87bbd09d-0d31-45dc-a4b7-21068f5f5564",
"code": 200,
"status": "success",
"error": null,
"data": true
}
异常示例
时间戳错误
{
"requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
"code": 400,
"status": "error",
"error": {
"code": 100,
"desc": "invalid timestamp"
},
"data": null
}
appId不正确
{
"requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
"code": 400,
"status": "error",
"error": {
"code": 101,
"desc": "application not exist"
},
"data": null
}
子账号不存在
{
"requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
"code": 400,
"status": "error",
"error": {
"code": 102,
"desc": "user children not exist"
},
"data": null
}
子账号过期
{
"requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
"code": 403,
"status": "error",
"error": {
"code": 103,
"desc": "user children expired"
},
"data": null
}
签名错误
{
"requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
"code": 403,
"status": "error",
"error": {
"code": 104,
"desc": "invalid signature"
},
"data": null
}
账号权限不足
{
"requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
"code": 403,
"status": "error",
"error": {
"code": 105,
"desc": "permission limited"
},
"data": null
}
分类id不存在
{
"requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
"code": 400,
"status": "error",
"error": {
"code": 3001,
"desc": "category not exist"
},
"data": null
}
不允许修改此分类设置,只能修改根目录下的一级目录
{
"requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
"code": 400,
"status": "error",
"error": {
"code": 3005,
"desc": "category could not be modified"
},
"data": true
}
Last updated