分页查询频道可设置接收转播频道列表
更新时间:2024-09-27 15:54:14
接口描述
1、通过一个(发起转播的)频道分页查询能够被它设置接收转播的频道列表
2、接口支持https协议
接口URL
http://api.polyv.net/live/v3/channel/basic/receive/list
请求方式
GET
接口约束
1、接口同时支持HTTP 、HTTPS ,建议使用HTTPS 确保接口安全,接口调用有频率限制,详细请查看
请求参数描述
| 参数名 | 必选 | 类型 | 说明 |
|---|---|---|---|
| appId | true | String | 账号appId【详见获取密钥】 |
| timestamp | true | Long | 当前13位毫秒级时间戳,3分钟内有效 |
| sign | true | String | 签名,为32位大写的MD5值,生成签名的appSecret密钥作为通信数据安全的关键信息,严禁保存在客户端直接使用,所有API都必须通过客户自己服务器中转调用POLYV服务器获取响应数据【详见签名生成规则】 |
| channelId | true | String | (发起转播的)频道号 |
| keyword | false | String | 频道名称,支持模糊搜索 |
| page | false | Integer | 查询页数,默认1 |
| pageSize | false | Integer | 每页数据大小,默认10 |
示例
http://api.polyv.net/live/v3/channel/basic/receive/list?appId=frlr1zazn3&sign=56C6413F1606D8950C0BCE2AEC7CD456&channelId=2788479×tamp=1642493607445
响应参数描述
| 参数名 | 类型 | 说明 |
|---|---|---|
| code | Integer | 响应状态码,200为成功返回,非200为失败【详见全局错误说明】 |
| status | String | 响应状态文本信息 |
| message | String | 响应描述信息,当code为400或者500的时候,辅助描述错误原因 |
| data | Object | 请求失败时为空,成功响应时返回全账号频道基础信息【详见data参数描述】 |
Data参数描述
| 参数名 | 类型 | 说明 |
|---|---|---|
| pageSize | Integer | 每页数据大小,默认20,最大20 |
| pageNumber | Integer | 当前页数 |
| totalItems | Integer | 总的条数 |
| contents | Array | 查询的结果列表【详见Contents参数描述】 |
| startRow | Integer | 当前页第一条记录在总结果集中的位置 |
| firstPage | Boolean | 是否为第一页,值为:true/false,默认为false |
| lastPage | Boolean | 是否为最后一页,值为:true/false,默认为false |
| prePageNumber | Integer | 上一页编号 |
| limit | Integer | 每页数量大小 |
| nextPageNumber | Integer | 下一页编号 |
| endRow | Integer | 当前页最后一条记录在总结果集中的位置 |
| totalPages | Integer | 总页数 |
| offset | Integer | 分页起始记录 |
Contents参数描述
| 参数名 | 类型 | 说明 |
|---|---|---|
| channelId | String | 频道号 |
| name | String | 频道名称 |
| channelPasswd | String | 频道密码,非研讨会场景使用 |
| hostPasswd | String | 研讨会主持人密码,研讨会场景使用 |
| attendeePasswd | String | 研讨会参会人密码,研讨会场景使用 |
| categoryName | String | 频道所属分类名称 |
| authType | String | 观看条件,使用,分隔,如:none,none none:无条件, pay:付费观看, code:验证码观看, phone:白名单观看, info:登记观看, custom:自定义授权观看, external:外部授权, direct:直接授权 |
| recentViewCount | Integer | 最近场次观看人数 |
| subChannelAccount | String | 第一个子频道号,如果没有子频道则为null |
| subChannelPasswd | String | 第一个子频道密码,如果没有子频道则为null |
| startTime | String | 直播开始时间 |
| transmitChannelId | String | 关联转播的频道号,如果没有关联则为null |
| scene | String | 场景 alone:活动直播 ppt:三分屏 topclass:大班课 |
Java请求示例
快速接入基础代码请下载相关依赖源码, 点击下载源代码 ,下载后加入到自己的源码工程中即可。测试用例中的HttpUtil.java 和 LiveSignUtil.java 都包含在下载文件中。
强烈建议您使用直播Java SDK完成API的功能对接,直播Java SDK 对API调用逻辑、异常处理、数据签名、HTTP请求线程池进行了统一封装和优化。
@Test
public void testGetReceiveList() throws IOException, NoSuchAlgorithmException {
//公共参数,填写自己的实际参数
String appId = super.appId;
String appSecret = super.appSecret;
String timestamp = String.valueOf(System.currentTimeMillis());
//业务参数
String channelId = "2788479";
String url = "http://api.polyv.net/live/v3/channel/basic/receive/list";
//http 调用逻辑
Map<String, String> requestMap = new HashMap<>();
requestMap.put("appId", appId);
requestMap.put("timestamp", timestamp);
requestMap.put("channelId", channelId);
//requestMap.put("keyword","");
//requestMap.put("page","");
//requestMap.put("pageSize","");
requestMap.put("sign", LiveSignUtil.getSign(requestMap, appSecret));
url = MapUtil.appendUrl(url, requestMap);
String response = HttpUtil.get(url, null);
log.info("测试分页查询频道可设置接收转播频道列表接口返回值:{}", response);
}
响应示例
系统全局错误说明详见全局错误说明
成功示例
{
"code": 200,
"status": "success",
"message": "",
"data": {
"pageSize": 10,
"pageNumber": 1,
"totalItems": 1,
"contents": [
{
"channelId": 1972965,
"name": "Spring 知识精讲",
"passwd": null,
"hostPasswd": null,
"attendeePasswd": null,
"categoryName": "默认分类",
"authType": "none,none",
"status": 7,
"recentViewCount": 0,
"subChannelAccount": null,
"subChannelPasswd": null,
"watchUrl": null,
"watchQRCodeUrl": null,
"scene": "alone",
"type": "receive",
"startTime": null,
"guest": null,
"pureRtcEnabled": "N",
"transmitType": "single",
"multipleRoom": null,
"creatorChildId": null,
"creatorName": null,
"rtcType": "agora",
"transmitChannelId": null,
"channelPasswd": "3I85nJ"
}
],
"offset": 0,
"limit": 1,
"nextPageNumber": 1,
"totalPages": 1,
"endRow": 1,
"startRow": 1,
"firstPage": true,
"lastPage": true,
"prePageNumber": 1
}
}
异常示例
{
"code": 403,
"status": "error",
"message": "invalid signature.",
"data": ""
}
