接口描述
1、通过分类id分页查询分类列表
2、接口支持https协议
接口URL
http://api.polyv.net/v3/category/get
在线API调用
请求方式
接口约束
1、接口同时支持HTTP 、HTTPS ,建议使用HTTPS 确保接口安全,接口调用有频率限制,详细请查看
请求参数描述
参数名 | 必选 | 类型 | 说明 |
---|
| | | 保利威点播子账户appId,获取路径:保利威点播后台->设置->账号管理 |
| | | |
| | | |
| | | |
| | | |
| | | |
示例
http://api.polyv.net/v3/category/get
表单参数:
cateId=1608891483165&appId=a0Wmol5EwX&sign=2A0027CB75FEF9F24DD6B680A2FC20AE×tamp=1617935598256
响应参数描述
参数名 | 类型 | 说明 |
---|
| | 每次请求的业务流水号,必须唯一,便于客户端/服务器端排查问题 |
| | 响应状态码,200为成功返回,非200为失败【详见全局错误说明】 |
| | |
| | |
| | |
error参数描述
data参数描述
category参数描述
subCategories参数描述
Java请求示例
快速接入基础代码请下载相关依赖源码, 点击下载源代码 ,下载后加入到自己的源码工程中即可。测试用例中的HttpUtil.java 和 VodSignUtil.java 都包含在下载文件中。
强烈建议您使用点播Java SDK完成API的功能对接,点播Java SDK 对API调用逻辑、异常处理、数据签名、HTTP请求线程池进行了统一封装和优化。
private static final Logger log = LoggerFactory.getLogger(VodSubAccountTest.class);
/**
* 查询分类列表
* @throws Exception
* @throws NoSuchAlgorithmException
*/
@Test
public void testSubGetCategories() 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/get";
String cateId = "1608891483165";
Map<String, String> requestMap = new HashMap<>();
requestMap.put("appId", appId);
requestMap.put("timestamp", timestamp);
requestMap.put("cateId", cateId);
requestMap.put("sign", VodSignUtil.getSignMd5(requestMap, appSecret));
String response = HttpUtil.postFormBody(url, requestMap);
log.debug("测试查询分类列表,{}", response);
//do somethings
}
响应示例
系统全局错误说明详见全局错误说明
成功示例
{
"requestId":"52ec91c6-4b2e-487e-976c-03378d3035af",
"code":200,
"status":"success",
"error":null,
"data":{
"category":{
"cateId":1608891483165,
"cateName":"伪直播功能专用分类",
"parentId":1
},
"subCategoryTotal":7,
"subCategories":[
{
"cateId":1608891483169,
"cateName":"2070151",
"parentId":1608891483165
},
{
"cateId":1610069551999,
"cateName":"2087172",
"parentId":1608891483165
},
{
"cateId":1610605203885,
"cateName":"2095792",
"parentId":1608891483165
},
{
"cateId":1615344036891,
"cateName":"2149710",
"parentId":1608891483165
},
{
"cateId":1615357280260,
"cateName":"2149813",
"parentId":1608891483165
},
{
"cateId":1616053580583,
"cateName":"2205908",
"parentId":1608891483165
},
{
"cateId":1616572747765,
"cateName":"1958888",
"parentId":1608891483165
}
]
}
}
异常示例
时间戳错误
{
"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
}
分类不存在
{
"requestId": "5ede3d23-45f0-4661-99be-e95d07daf049",
"code": 400,
"status": "error",
"error": {
"code": 3001,
"desc": "category not exist"
},
"data": null
}