获取全账号频道基础信息接口

接口URL

https://api.polyv.net/live/v3/channel/basic/list

接口说明

(接口调用有频率限制,详细请查看)

1、获取账号下所有的频道基础信息列表
2、接口支持https协议

返回结果支持格式

JSON

请求方式

GET

请求数限制

TRUE

请求参数

参数名 必选 类型 说明
appId string 从API设置中获取,在直播系统登记的appId
timestamp long 当前13位毫秒级时间戳,3分钟内有效
sign string 签名,为32位的MD5值大写
categoryIds string 分类ID,多个id用","分隔
page int 查询页数,默认1
pageSize int 每页大小,默认20,最大20

响应成功JSON示例:

{
    "code": 200,
    "status": "success",
    "message": "",
    "data": {
        "pageSize": 10,
        "pageNumber": 1,
        "totalItems": 5,
        "contents": [
            {
                "channelId": 1947328,
                "name": "阿里云",
                "publisher": "主持人",
                "startTime": 1604113200000,
                "pageView": 110,
                "likes": 1,
                "coverImg": "https://liveimages.videocc.net/assets/wimages/pc_images/logo.png",
                "splashImg": "https://liveimages.videocc.net/uploaded/images/2020/11/ftbm6uuzoa.jpg",
                "splashEnabled": "N",
                "desc": "",
                "maxViewer": -1,
                "watchStatus": "playback",
                "watchStatusText": "回放中",
                "onlineNum": 0,
                "bgImg": null,
                "videoList": [
                    {
                        "videoId": "63af1f1bff",
                        "videoPoolId": "cf7f07e096aa3c17fa480f0822b1a990_c"
                    }
                ],
                "categoryId": 341097
            },
            {
                "channelId": 1947327,
                "name": "华为云",
                "publisher": "主持人",
                "startTime": 0,
                "pageView": 6,
                "likes": 0,
                "coverImg": "https://liveimages.videocc.net/assets/wimages/pc_images/logo.png",
                "splashImg": null,
                "splashEnabled": "N",
                "desc": "",
                "maxViewer": -1,
                "watchStatus": "playback",
                "watchStatusText": "回放中",
                "onlineNum": 0,
                "bgImg": null,
                "videoList": [
                    {
                        "videoId": "052f4509f2",
                        "videoPoolId": "cf7f07e096152ef186b0ea9b247998cd_c"
                    }
                ],
                "categoryId": 341097
            },
            {
                "channelId": 1947326,
                "name": "ucloud",
                "publisher": "主持人",
                "startTime": 0,
                "pageView": 16,
                "likes": 0,
                "coverImg": "https://liveimages.videocc.net/assets/wimages/pc_images/logo.png",
                "splashImg": null,
                "splashEnabled": "N",
                "desc": "",
                "maxViewer": -1,
                "watchStatus": "end",
                "watchStatusText": "已结束",
                "onlineNum": 0,
                "bgImg": null,
                "videoList": [
                    {
                        "videoId": "1138f32f38",
                        "videoPoolId": "cf7f07e0965e6522206f6a8868dd39f0_c"
                    },
                    {
                        "videoId": "ac020d89cd",
                        "videoPoolId": "cf7f07e09621aa213e19929565a0d08f_c"
                    }
                ],
                "categoryId": 341097
            },
            {
                "channelId": 1947324,
                "name": "金山云",
                "publisher": "主持人",
                "startTime": 0,
                "pageView": 1,
                "likes": 0,
                "coverImg": "https://liveimages.videocc.net/assets/wimages/pc_images/logo.png",
                "splashImg": null,
                "splashEnabled": "N",
                "desc": "",
                "maxViewer": -1,
                "watchStatus": "end",
                "watchStatusText": "已结束",
                "onlineNum": 0,
                "bgImg": null,
                "videoList": [
                    {
                        "videoId": "941d2ebfb6",
                        "videoPoolId": "cf7f07e0961129e67a9d11c73685f3dc_c"
                    },
                    {
                        "videoId": "553b71d9f9",
                        "videoPoolId": "cf7f07e096795233489f311d9e0d64f7_c"
                    }
                ],
                "categoryId": 341097
            },
            {
                "channelId": 1947220,
                "name": "网宿",
                "publisher": "主持人",
                "startTime": 0,
                "pageView": 12,
                "likes": 0,
                "coverImg": "https://liveimages.videocc.net/assets/wimages/pc_images/logo.png",
                "splashImg": null,
                "splashEnabled": "N",
                "desc": "",
                "maxViewer": -1,
                "watchStatus": "playback",
                "watchStatusText": "回放中",
                "onlineNum": 0,
                "bgImg": null,
                "videoList": [
                    {
                        "videoId": "da8de8de37",
                        "videoPoolId": "cf7f07e0961c4ba7e6279ea1add9fc37_c"
                    },
                    {
                        "videoId": "1e9c53a8cd",
                        "videoPoolId": "cf7f07e096b83531e76910375f2b62ec_c"
                    }
                ],
                "categoryId": 341097
            }
        ],
        "startRow": 1,
        "firstPage": true,
        "lastPage": true,
        "prePageNumber": 1,
        "limit": 5,
        "endRow": 5,
        "nextPageNumber": 1,
        "totalPages": 1,
        "offset": 0
    }
}

响应失败JSON示例:

未输入appId

{
    "code": 400,
    "status": "error",
    "message": "appId is required.",
    "data": ""
}

appId不正确

{
    "code": 400,
    "status": "error",
    "message": "application not found.",
    "data": ""
}

时间戳错误

{
    "code": 400,
    "status": "error",
    "message": "invalid timestamp.",
    "data": ""
}

签名错误

{
    "code": 403,
    "status": "error",
    "message": "invalid signature.",
    "data": ""
}

字段说明

参数名 类型 说明
code int 响应代码,成功为200,失败为400,签名错误为401,异常错误500
status string 成功为success,失败为error
message string 错误时为错误提示消息
data Page 响应结果集

Page对象

参数名 类型 说明
pageNumber int 列表页数
totalItems int 总数
contents List 频道的详细信息列表,无数据时为空,参考Detail对象

Detail对象

参数名 类型 说明
channelId int 频道号
name string 频道名称
publisher string 主持人名称
startTime long 直播开始时间,关闭时为0,开启时为13位毫秒级时间戳
pageView int 页面累计观看数
likes int 观看页点赞数
coverImg string 频道图标url
splashImg string 频道引导图url
splashEnabled string 引导页开关,取值为: Y/N
desc string 直播介绍
maxViewer int 最大在线观看人数
watchStatus string 频道的观看页状态,取值为: 频道状态,取值:live(直播中)、end(直播结束)、playback(回放中)、waiting(等待直播)
watchStatusDesc string 观看页状态描述,直播中,回放中,已结束,未开始
onlineNum int 在线人数
bgImg string 暖场图片URL
videoList List 回放视频列表,当有多个时按添加时间倒叙排列;参考Video对象
categoryId int 分类ID

Video对象

参数名 类型 说明
videoId string 直播系统生成的id (视频库中的回放视频)
videoPoolId string 点播视频vid (视频库中的回放视频)

Java请求示例

public static void testGetUserRealTimeConcurrence() {
        String url = "https://api.polyv.net/live/v3/channel/basic/list";
        // 用户对应的appId和加密串
        String appId = "xxxxxxxxx";
        String appSecret = "xxxxxxxxxxxxxxxxxxxxxxxxxx";
        Map<String, String> params = new HashMap<>();
        PolyvTool.setLiveSign(params, appId, appSecret);
        // 调用Polyv的httpClient工具类发送请求
        HttpClientUtil.getInstance()
                .sendHttpGet(url + "?" + PolyvTool.mapJoinNotEncode(params));
        System.out.println(content);
    }

签名规则(PolyvTool.java文件代码查看)

https://dev.polyv.net/2020/liveproduct/l-api/rule/live-api-java-detail/

以上内容是否对您有帮助?根本没有帮助文档较差文档一般文档不错文档很好
Loading...