查询所有频道的详细信息

旧版接口地址查询所有频道的详细信息(旧版)

接口描述

1、查询账号下所有频道详细信息列表,观看页状态与新版后台一致
2、接口支持https协议

接口URL

http://api.polyv.net/live/v4/channel/detail/list

在线API调用

请求方式

GET

接口约束

1、接口同时支持HTTP 、HTTPS ,建议使用HTTPS 确保接口安全,接口调用有频率限制,详细请查看

请求参数描述

参数名必选类型说明

appId

true

String

账号appId【详见获取密钥

timestamp

true

Long

当前13位毫秒级时间戳,3分钟内有效

sign

true

String

签名,为32位大写的MD5值,生成签名的appSecret密钥作为通信数据安全的关键信息,严禁保存在客户端直接使用,所有API都必须通过客户自己服务器中转调用POLYV服务器获取响应数据【详见签名生成规则

pageNumber

false

Integer

页数默认为1

pageSize

false

Integer

每页显示的数据条数,默认每页显示10条数据,最大值不能超过1000

categoryId

false

String

所属分类id

watchStatus

false

String

观看页状态筛选 live:直播中 playback:回放中 end:已结束 waiting:等待中 unStart:未开始

keyword

false

String

频道名称,模糊查询

orderBy

false

String

排序字段,默认按频道创建时间升序 startTimeDesc:开播时间降序 startTimeAsc:开播时间升序 channelCreatedTimeDesc:频道创建时间降序

示例

http://api.polyv.net/live/v4/channel/detail/list?pageNumber=2&watchStatus=unStart&appId=frlr1zazn3&sign=49428741C1D7BEE8BE1EE545F066ECC7&pageSize=3&keyword=%E6%B5%8B%E8%AF%95&categoryId=340019&timestamp=1642734850008

响应参数描述

参数名类型说明

code

Integer

状态码,与 http 状态码相同,用于确定基本的响应状态

status

String

响应结果,由业务决定,成功返回success,失败返回error

success

Boolean

是否成功响应

requestId

String

请求ID,每次请求生成的唯一的 UUID,仅可用于排查、调试,不应该和业务挂上钩

error

Object

状态码非200时的错误信息【详见Error字段描述

data

Object

【详见data字段说明

Error参数描述

参数名类型说明

code

Integer

错误代码,用于确定具体的错误原因

desc

String

错误描述,与 error.code 对应

Data参数描述

参数名类型说明

pageNumber

Integer

当前页码

pageSize

Integer

每页数据量

totalPages

Long

页面总数

totalItems

Long

总数据量

contents

Array

当前页内容【详见contents字段说明

Contents参数描述

参数名类型说明

channelId

String

频道号

name

String

频道名称

channelPasswd

String

频道密码

categoryId

String

分类ID

scene

String

场景 alone:活动直播 ppt:三分屏 topclass:大班课 seminar:研讨会

newScene

String

新版后台直播场景,若未定义则取scene undefined:未定义 topclass:大班课 double:双师课(需开通权限) train:企业培训 seminar:研讨会 alone:活动营销

template

String

新版后台直播模板,若老版频道,该字段为未定义 undefined:未定义 ppt-三分屏(横屏) portrait_ppt-三分屏(竖屏) alone-纯视频(横屏) portrait_alone-纯视频(竖屏) topclass-纯视频-极速(横屏) portrait_topclass-纯视频-极速(竖屏) seminar-研讨会

watchStatus

String

观看页状态 live:直播中 playback:回放中 end:已结束 waiting:等待中 unStart:未开始 banpush:已禁播

watchStatusText

String

观看页状态描述,直播中,回放中,已结束,等待中,未开始,已禁播

sceneText

String

场景描述

watchUrl

String

观看页链接

content

String

直播介绍

startTime

Long

直播开始时间,13位毫秒级时间戳

pureRtcEnabled

String

直播延迟 Y无延时 N普通延迟

channelLogo

String

频道图标

splashImg

String

频道引导图

splashEnabled

String

引导页开关 Y:开启 N:关闭

publisher

String

主持人名称

authSetting

Array

观看条件设置【详见authSetting参数描述

authSetting参数描述

参数名类型说明

channelId

String

频道号

rank

Integer

用于实现一个频道设置两个观看条件,为1或2 1:主要条件 2:次要条件

userId

String

POLYV用户ID,和保利威官网一致,获取路径:官网->登录->直播(开发设置)

globalSettingEnabled

String

是否开启全局设置 Y:开启 N:关闭

enabled

String

是否开启观看条件 Y:开启 N:关闭

authType

String

观看条件类型 none:无限制 code:验证码观看 pay:付费观看 phone:白名单观看 info:登记观看 wxshare:分享观看 custom:自定义授权观看 external:外部授权观看

payAuthTips

String

付费观看提示信息

price

Float

付费观看的价格

watchEndTime

Long

付费观看,截止时间,13位毫秒级时间戳,为null表示:一次付费,永久有效

validTimePeriod

Integer

付费观看的截止时长(天)

infoAuthTips

String

登记观看提示信息

infoDesc

String

登记观看的描述字段

codeAuthTips

String

验证码观看提示信息

authCode

String

验证码观看的验证码

qcodeTips

String

验证码观看的二维码提示

qcodeImg

String

验证码观看的二维码图片

customKey

String

自定义授权观看的key

customUri

String

自定义授权观看的接口地址

externalKey

String

外部授权观看的key

externalUri

String

外部授权观看的接口地址

externalRedirectUri

String

外部授权观看,用户直接访问观看页时的跳转地址

directKey

String

独立授权key

trialWatchEnabled

String

试看开关 Y:开启试看 N:关闭试看

trialWatchTime

Integer

试看时间,单位为分钟

trialWatchEndTime

Long

试看截止日期,13位毫秒级时间戳,为null 表示对该频道永久有效

authTips

String

白名单观看提示信息

whiteListInputTips

String

白名单输入提示

whiteListEntryText

String

白名单入口文案

Java请求示例

快速接入基础代码请下载相关依赖源码, 点击下载源代码 ,下载后加入到自己的源码工程中即可。测试用例中的HttpUtil.java 和 LiveSignUtil.java 都包含在下载文件中。

强烈建议您使用直播Java SDK完成API的功能对接,直播Java SDK 对API调用逻辑、异常处理、数据签名、HTTP请求线程池进行了统一封装和优化。

private static final Logger log = LoggerFactory.getLogger(ChannelOperateTest.class);
/**
 * 查询所有频道的详细信息
 * @throws IOException
 * @throws NoSuchAlgorithmException
 */
@Test
public void testChannelDetailList() throws IOException, NoSuchAlgorithmException {
    //公共参数,填写自己的实际参数
    String appId = super.appId;
    String appSecret = super.appSecret;
    String userId = super.userId;
    String timestamp = String.valueOf(System.currentTimeMillis());
    //业务参数
    String url = "http://api.polyv.net/live/v4/channel/detail/list";
    String keyword = "测试";
    String categoryId = "340019";
    String watchStatus = "unStart";
    String pageNumber = "2";
    String pageSize = "3";
    
    Map<String, String> requestMap = new HashMap<>();
    requestMap.put("appId", appId);
    requestMap.put("timestamp", timestamp);
    requestMap.put("categoryId", categoryId);
    requestMap.put("keyword", keyword);
    requestMap.put("watchStatus", watchStatus);
    requestMap.put("pageNumber", pageNumber);
    requestMap.put("pageSize", pageSize);
    requestMap.put("sign", LiveSignUtil.getSign(requestMap, appSecret));
    String response = HttpUtil.get(url, requestMap);
    log.info("测试查询所有频道的详细信息,返回值:{}", response);
    //do somethings
    
}

响应示例

系统全局错误说明详见全局错误说明

成功示例

{
    "code": 200,
    "status": "success",
    "requestId": "11208b877f3543af8b0e65a393031027.64.16427348530723753",
    "data": {
        "pageNumber": 2,
        "pageSize": 3,
        "totalPages": 2,
        "totalItems": 5,
        "contents": [
            {
                "channelId": 2779045,
                "name": "测试",
                "channelPasswd": "6dMuVz",
                "categoryId": 340019,
                "scene": "alone",
                "newScene": "alone",
                "template": "portrait_alone",
                "watchStatus": "unStart",
                "watchStatusText": "未开始",
                "sceneText": "纯视频(专业)",
                "watchUrl": "https://live.polyv.cn/watch/2779045",
                "content": "",
                "startTime": null,
                "pureRtcEnabled": "N",
                "channelLogo": "//liveimages.videocc.net/assets/wimages/pc_images/logo.png",
                "splashImg": "//liveimages.videocc.net/uploaded/images/2021/09/g2bta2pjbw.jpg",
                "splashEnabled": "Y",
                "publisher": "主持人",
                "authSetting": [
                    {
                        "channelId": 2779045,
                        "userId": "1b448be323",
                        "rank": 1,
                        "globalSettingEnabled": "N",
                        "enabled": "N",
                        "authType": "external",
                        "authTips": "欢迎观看本次直播",
                        "payAuthTips": "欢迎观看本次直播",
                        "codeAuthTips": "欢迎观看本次直播",
                        "infoAuthTips": "欢迎观看本次直播",
                        "authCode": "",
                        "qcodeTips": null,
                        "qcodeImg": null,
                        "price": 0.01,
                        "watchEndTime": null,
                        "validTimePeriod": null,
                        "customKey": "ujpTIPloEw",
                        "customUri": "",
                        "externalKey": "ujpTIPloEw",
                        "externalUri": "http://www.polyv.net",
                        "externalRedirectUri": "",
                        "externalEntryText": "登录观看",
                        "directKey": "ujpTIPloEw",
                        "trialWatchEnabled": "N",
                        "trialWatchTime": 1,
                        "trialWatchEndTime": null,
                        "whiteListInputTips": "请输入会员码-1605067278063",
                        "whiteListEntryText": "会员入口",
                        "infoDesc": ""
                    },
                    {
                        "channelId": 2779045,
                        "userId": "1b448be323",
                        "rank": 2,
                        "globalSettingEnabled": "N",
                        "enabled": "N",
                        "authType": "none",
                        "authTips": "欢迎观看本次直播",
                        "payAuthTips": "欢迎观看本次直播",
                        "codeAuthTips": "欢迎观看本次直播",
                        "infoAuthTips": "欢迎观看本次直播",
                        "authCode": null,
                        "qcodeTips": null,
                        "qcodeImg": null,
                        "price": 0,
                        "watchEndTime": null,
                        "validTimePeriod": null,
                        "customKey": "ujpTIPloEw",
                        "customUri": null,
                        "externalKey": "ujpTIPloEw",
                        "externalUri": null,
                        "externalRedirectUri": null,
                        "externalEntryText": "",
                        "directKey": "ujpTIPloEw",
                        "trialWatchEnabled": "N",
                        "trialWatchTime": null,
                        "trialWatchEndTime": null,
                        "whiteListInputTips": null,
                        "whiteListEntryText": "会员入口",
                        "infoDesc": null
                    }
                ]
            },
            {
                "channelId": 2779196,
                "name": "测试",
                "channelPasswd": "6dMuVz",
                "categoryId": 340019,
                "scene": "alone",
                "newScene": "alone",
                "template": "portrait_alone",
                "watchStatus": "unStart",
                "watchStatusText": "未开始",
                "sceneText": "纯视频(专业)",
                "watchUrl": "https://live.polyv.cn/watch/2779196",
                "content": "",
                "startTime": 1642453440000,
                "pureRtcEnabled": "N",
                "channelLogo": "//liveimages.videocc.net/assets/wimages/pc_images/logo.png",
                "splashImg": "//liveimages.videocc.net/uploaded/images/2021/09/g2bta2pjbw.jpg",
                "splashEnabled": "Y",
                "publisher": "主持人",
                "authSetting": [
                    {
                        "channelId": 2779196,
                        "userId": "1b448be323",
                        "rank": 1,
                        "globalSettingEnabled": "N",
                        "enabled": "N",
                        "authType": "external",
                        "authTips": "欢迎观看本次直播",
                        "payAuthTips": "欢迎观看本次直播",
                        "codeAuthTips": "欢迎观看本次直播",
                        "infoAuthTips": "欢迎观看本次直播",
                        "authCode": "",
                        "qcodeTips": null,
                        "qcodeImg": null,
                        "price": 0.01,
                        "watchEndTime": null,
                        "validTimePeriod": null,
                        "customKey": "ujpTIPloEw",
                        "customUri": "",
                        "externalKey": "ujpTIPloEw",
                        "externalUri": "http://www.polyv.net",
                        "externalRedirectUri": "",
                        "externalEntryText": "登录观看",
                        "directKey": "ujpTIPloEw",
                        "trialWatchEnabled": "N",
                        "trialWatchTime": 1,
                        "trialWatchEndTime": null,
                        "whiteListInputTips": "请输入会员码-1605067278063",
                        "whiteListEntryText": "会员入口",
                        "infoDesc": ""
                    },
                    {
                        "channelId": 2779196,
                        "userId": "1b448be323",
                        "rank": 2,
                        "globalSettingEnabled": "N",
                        "enabled": "N",
                        "authType": "none",
                        "authTips": "欢迎观看本次直播",
                        "payAuthTips": "欢迎观看本次直播",
                        "codeAuthTips": "欢迎观看本次直播",
                        "infoAuthTips": "欢迎观看本次直播",
                        "authCode": null,
                        "qcodeTips": null,
                        "qcodeImg": null,
                        "price": 0,
                        "watchEndTime": null,
                        "validTimePeriod": null,
                        "customKey": "ujpTIPloEw",
                        "customUri": null,
                        "externalKey": "ujpTIPloEw",
                        "externalUri": null,
                        "externalRedirectUri": null,
                        "externalEntryText": "",
                        "directKey": "ujpTIPloEw",
                        "trialWatchEnabled": "N",
                        "trialWatchTime": null,
                        "trialWatchEndTime": null,
                        "whiteListInputTips": null,
                        "whiteListEntryText": "会员入口",
                        "infoDesc": null
                    }
                ]
            }
        ]
    },
    "success": true
}

异常示例

{
    "code": 400,
    "status": "error",
    "error": {
        "code": 10003,
        "desc": "时间戳过期"
    },
    "success": false
}

Last updated