1、通过视频id批量移动视频到指定分类下
2、接口URL中的{userid}为点播账号userid,具体参考菜单【使用须知】->【获取密钥】
3、接口支持https协议
http://api.polyv.net/v2/video/{userid}/changeCata
http://api.polyv.net/v2/video/1b448be323/changeCata
vids=1b448be323ae991b1dfc5136597618d1_1&sign=89173A5372BD1FE2F31610C177D8D075803E9E4E&cataid=1602300731843&userid=1b448be323&ptime=1617158821090
强烈建议您使用点播Java SDK完成API的功能对接,点播Java SDK 对API调用逻辑、异常处理、数据签名、HTTP请求线程池进行了统一封装和优化。
private static final Logger log = LoggerFactory.getLogger(VodVideoManagementTest.class);
/**
* 移动视频到指定分类
*/
@Test
public void testMoveVideo() throws Exception, NoSuchAlgorithmException {
//公共参数,填写自己的实际参数
String secretKey = super.secretKey;
String userid = super.userId;
String ptime = String.valueOf(System.currentTimeMillis());
//业务参数
String vids = "1b448be323ae991b1dfc5136597618d1_1";
String cataid = "1602300731843";
String url = "http://api.polyv.net/v2/video/" + userid + "/changeCata";
Map<String, String> requestMap = new HashMap<>();
requestMap.put("userid", userid);
requestMap.put("ptime", ptime);
requestMap.put("vids", vids);
requestMap.put("cataid", cataid);
//系统只对部分参数进行签名
Map<String, String> signMap = new HashMap<>();
signMap.put("userid", userId);
signMap.put("ptime", ptime);
signMap.put("vids", vids);
signMap.put("cataid", cataid);
requestMap.put("sign", VodSignUtil.getSign(signMap, secretKey));
String response = HttpUtil.postFormBody(url, requestMap);
log.debug("测试移动视频到指定分类,{}", response);
//do somethings
}
{
"code": 200,
"status": "success",
"message": "success",
"data": true
}
{
"code": 400,
"status": "error",
"message": "ptime is too old.",
"data": ""
}