> For the complete documentation index, see [llms.txt](https://polyv.gitbook.io/document/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://polyv.gitbook.io/document/docs/live/api/v-4/channel/operate/channel_detail_list.md).

# 查询所有频道的详细信息

旧版接口地址[查询所有频道的详细信息(旧版)](https://git.polyv.net/help-center/document-center/-/blob/master/live/api/account/channel_detail/README.md)

### 接口描述

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

### 接口URL

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

[在线API调用](https://git.polyv.net/help-center/document-center/-/blob/master/req.html?api=http:/api.polyv.net/live/v4/channel/detail/list/README.md)

### 请求方式

```
GET
```

### 接口约束

1、接口同时支持HTTP 、HTTPS ，建议使用HTTPS 确保接口安全，接口调用有频率限制，[详细请查看](https://git.polyv.net/help-center/document-center/-/blob/master/live/api/limit/README.md)

### 请求参数描述

| 参数名         | 必选    | 类型      | 说明                                                                                                                                                                                                        |
| ----------- | ----- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| appId       | true  | String  | 账号appId【详见[获取密钥](https://git.polyv.net/help-center/document-center/-/blob/master/live/api/getSecretKey/README.md)】                                                                                        |
| timestamp   | true  | Long    | 当前13位毫秒级时间戳，3分钟内有效                                                                                                                                                                                        |
| sign        | true  | String  | 签名，为32位大写的MD5值,`生成签名的appSecret密钥作为通信数据安全的关键信息，严禁保存在客户端直接使用，所有API都必须通过客户自己服务器中转调用POLYV服务器获取响应数据`【详见[签名生成规则](https://git.polyv.net/help-center/document-center/-/blob/master/live/api/buildSign/README.md)】 |
| pageNumber  | false | Integer | 页数默认为1                                                                                                                                                                                                    |
| pageSize    | false | Integer | 每页显示的数据条数，默认每页显示10条数据，最大值不能超过1000                                                                                                                                                                         |
| categoryId  | false | String  | 所属分类id                                                                                                                                                                                                    |
| watchStatus | false | String  | <p>观看页状态筛选<br>live：直播中<br>playback：回放中<br>end：已结束<br>waiting：等待中<br>unStart：未开始</p>                                                                                                                       |
| keyword     | false | String  | 频道名称，模糊查询                                                                                                                                                                                                 |
| orderBy     | false | String  | <p>排序字段，默认按频道创建时间升序<br>startTimeDesc：开播时间降序<br>startTimeAsc：开播时间升序<br>channelCreatedTimeDesc：频道创建时间降序</p>                                                                                                 |

### 示例

```requestUrl
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字段描述](#error参数描述)】 |
| data      | Object  | 【详见[data字段说明](#data参数描述)】                |

### Error参数描述

| 参数名  | 类型      | 说明                   |
| ---- | ------- | -------------------- |
| code | Integer | 错误代码，用于确定具体的错误原因     |
| desc | String  | 错误描述，与 error.code 对应 |

### Data参数描述

| 参数名        | 类型      | 说明                                     |
| ---------- | ------- | -------------------------------------- |
| pageNumber | Integer | 当前页码                                   |
| pageSize   | Integer | 每页数据量                                  |
| totalPages | Long    | 页面总数                                   |
| totalItems | Long    | 总数据量                                   |
| contents   | Array   | 当前页内容【详见[contents字段说明](#contents参数描述)】 |

### Contents参数描述

| 参数名             | 类型     | 说明                                                                                                                                                                                                        |
| --------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| channelId       | String | 频道号                                                                                                                                                                                                       |
| name            | String | 频道名称                                                                                                                                                                                                      |
| channelPasswd   | String | 频道密码                                                                                                                                                                                                      |
| categoryId      | String | 分类ID                                                                                                                                                                                                      |
| scene           | String | <p>场景<br>alone：活动直播<br>ppt：三分屏<br>topclass：大班课<br>seminar：研讨会</p>                                                                                                                                         |
| newScene        | String | <p>新版后台直播场景，若未定义则取scene<br>undefined：未定义<br>topclass：大班课<br>double：双师课（需开通权限）<br>train：企业培训<br>seminar：研讨会<br>alone：活动营销</p>                                                                              |
| template        | String | <p>新版后台直播模板，若老版频道，该字段为未定义<br>undefined：未定义<br>ppt-三分屏(横屏)<br>portrait\_ppt-三分屏(竖屏)<br>alone-纯视频(横屏)<br>portrait\_alone-纯视频(竖屏)<br>topclass-纯视频-极速(横屏)<br>portrait\_topclass-纯视频-极速(竖屏)<br>seminar-研讨会</p> |
| watchStatus     | String | <p>观看页状态<br>live：直播中<br>playback：回放中<br>end：已结束<br>waiting：等待中<br>unStart：未开始<br>banpush：已禁播</p>                                                                                                          |
| watchStatusText | String | 观看页状态描述，直播中，回放中，已结束，等待中，未开始，已禁播                                                                                                                                                                           |
| sceneText       | String | 场景描述                                                                                                                                                                                                      |
| watchUrl        | String | 观看页链接                                                                                                                                                                                                     |
| content         | String | 直播介绍                                                                                                                                                                                                      |
| startTime       | Long   | 直播开始时间，13位毫秒级时间戳                                                                                                                                                                                          |
| pureRtcEnabled  | String | 直播延迟 Y无延时 N普通延迟                                                                                                                                                                                           |
| channelLogo     | String | 频道图标                                                                                                                                                                                                      |
| splashImg       | String | 频道引导图                                                                                                                                                                                                     |
| splashEnabled   | String | <p>引导页开关<br>Y：开启<br>N：关闭</p>                                                                                                                                                                              |
| publisher       | String | 主持人名称                                                                                                                                                                                                     |
| authSetting     | Array  | 观看条件设置【详见[authSetting参数描述](#authSetting参数描述)】                                                                                                                                                             |

### authSetting参数描述

| 参数名                  | 类型      | 说明                                                                                                                                   |
| -------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| channelId            | String  | 频道号                                                                                                                                  |
| rank                 | Integer | <p>用于实现一个频道设置两个观看条件，为1或2<br>1：主要条件<br>2：次要条件</p>                                                                                     |
| userId               | String  | POLYV用户ID，和保利威官网一致，获取路径：官网->登录->直播（开发设置）                                                                                             |
| globalSettingEnabled | String  | <p>是否开启全局设置<br>Y：开启<br>N：关闭</p>                                                                                                      |
| enabled              | String  | <p>是否开启观看条件<br>Y：开启<br>N：关闭</p>                                                                                                      |
| authType             | String  | <p>观看条件类型<br>none：无限制<br>code：验证码观看<br>pay：付费观看<br>phone：白名单观看<br>info：登记观看<br>wxshare：分享观看<br>custom：自定义授权观看<br>external：外部授权观看</p> |
| 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  | <p>试看开关<br>Y：开启试看<br>N：关闭试看</p>                                                                                                      |
| trialWatchTime       | Integer | 试看时间，单位为分钟                                                                                                                           |
| trialWatchEndTime    | Long    | 试看截止日期，13位毫秒级时间戳，为null 表示对该频道永久有效                                                                                                    |
| authTips             | String  | 白名单观看提示信息                                                                                                                            |
| whiteListInputTips   | String  | 白名单输入提示                                                                                                                              |
| whiteListEntryText   | String  | 白名单入口文案                                                                                                                              |

### Java请求示例

快速接入基础代码请下载相关依赖源码， [点击下载源代码](https://git.polyv.net/help-center/document-center/-/blob/master/third_res/util.zip) ,下载后加入到自己的源码工程中即可。测试用例中的**HttpUtil.java 和 LiveSignUtil.java** 都包含在下载文件中。

> 强烈建议您使用[直播Java SDK](https://git.polyv.net/help-center/document-center/-/blob/master/live/java/README.md)完成API的功能对接，直播Java SDK 对API调用逻辑、异常处理、数据签名、HTTP请求线程池进行了统一封装和优化。

```java
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
    
}
```

### 响应示例

系统全局错误说明详见[全局错误说明](https://git.polyv.net/help-center/document-center/-/blob/master/live/api/errorInfo/README.md)

成功示例

```json
{
    "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
}
```

异常示例

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