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

### 接口描述

```
1、查询账号下所有频道详细信息列表
2、接口支持https协议
```

### 接口URL

```
http://api.polyv.net/live/v3/channel/management/list-detail
```

### 请求方式

```
POST
```

### 接口约束

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)】 |
| page        | false | Integer | 页数默认为1                                                                                                                                                                                                    |
| pageSize    | false | Integer | 每页显示的数据条数，默认每页显示20条数据                                                                                                                                                                                     |
| categoryId  | false | String  | 所属分类id                                                                                                                                                                                                    |
| watchStatus | false | String  | <p>观看页状态筛选<br>live：直播中<br>playback：回放中<br>end：已结束<br>waiting：等待中</p>                                                                                                                                      |
| keyword     | false | String  | 频道名称，模糊查询                                                                                                                                                                                                 |

### 示例

```requestUrl
http://api.polyv.net/live/v3/channel/management/list-detail
```

表单参数：

```requestUrl
watchStatus=playback&appId=frlr1zazn3&sign=BDEE4A11F8720DC0FD40E33DE159536B&pageSize=20&page=1&keyword=%E6%B5%8B%E8%AF%95&categoryId=345134&timestamp=1621841244430
```

### 响应参数描述

| 参数名     | 类型      | 说明                                                                                                                                        |
| ------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| code    | Integer | 响应状态码，200为成功返回，非200为失败【详见[全局错误说明](https://git.polyv.net/help-center/document-center/-/blob/master/live/api/errorInfo/README.md)】          |
| status  | String  | 响应状态文本信息                                                                                                                                  |
| message | String  | 响应描述信息，当code为400或者500的时候，辅助描述错误原因                                                                                                         |
| data    | Object  | 响应成功时返回频道详细信息【详见[data字段说明](https://git.polyv.net/help-center/document-center/-/blob/master/live/api/account/channel_detail.md?id=polyv1)】 |

**Data参数描述**

| 参数名            | 类型      | 说明                                                                                                                                       |
| -------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| pageSize       | Integer | 每页数据大小，默认20条数据                                                                                                                           |
| pageNumber     | Integer | 当前页数                                                                                                                                     |
| totalItems     | Integer | 总的条数                                                                                                                                     |
| contents       | Array   | 频道详细信息列表【详见[Contents参数描述](https://git.polyv.net/help-center/document-center/-/blob/master/live/api/account/channel_detail.md?id=polyv2)】 |
| startRow       | Integer | 当前页第一条记录在总结果集中的位置                                                                                                                        |
| firstPage      | Boolean | 是否为第一页，值为：true/false，默认为false                                                                                                            |
| lastPage       | Boolean | 是否为最后一页，值为：true/false，默认为false                                                                                                           |
| prePageNumber  | Integer | 上一页编号                                                                                                                                    |
| limit          | Integer | 每页数量大小                                                                                                                                   |
| totalPages     | Integer | 总页数                                                                                                                                      |
| endRow         | Integer | 当前页最后一条记录在总结果集中的位置                                                                                                                       |
| nextPageNumber | Integer | 下一页编号                                                                                                                                    |
| offset         | Integer | 分页起始记录                                                                                                                                   |

**Contents参数描述**

| 参数名             | 类型     | 说明                                                                                                                                        |
| --------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------- |
| channelId       | String | 频道号                                                                                                                                       |
| name            | String | 频道名称                                                                                                                                      |
| channelPasswd   | String | 频道密码                                                                                                                                      |
| categoryId      | String | 分类ID                                                                                                                                      |
| scene           | String | <p>场景<br>alone：活动直播<br>ppt：三分屏<br>topclass：大班课<br>seminar：研讨会</p>                                                                         |
| watchStatus     | String | <p>观看页状态<br>live：直播中<br>playback：回放中<br>end：已结束<br>waiting：等待中</p>                                                                        |
| watchStatusText | String | 观看页状态描述，直播中，回放中，已结束，等待中                                                                                                                   |
| sceneText       | String | 场景描述                                                                                                                                      |
| watchUrl        | String | 观看页链接                                                                                                                                     |
| content         | String | 直播介绍                                                                                                                                      |
| startTime       | Long   | 直播开始时间，13位毫秒级时间戳                                                                                                                          |
| channelLogo     | String | 频道图标                                                                                                                                      |
| splashImg       | String | 频道引导图                                                                                                                                     |
| splashEnabled   | String | <p>引导页开关<br>Y：开启<br>N：关闭</p>                                                                                                              |
| publisher       | String | 主持人名称                                                                                                                                     |
| authSetting     | Array  | 观看条件设置【详见[authSetting参数描述](https://git.polyv.net/help-center/document-center/-/blob/master/live/api/account/channel_detail.md?id=polyv3)】 |

**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(AccountTest.class);
/**
 * 查询所有频道的详细信息
 * @throws IOException
 * @throws NoSuchAlgorithmException
 */
@Test
public void testChannelDetail() 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/v3/channel/management/list-detail";
    String categoryId="345134";
    String watchStatus="playback";
    String keyword="测试";
    String page=String.valueOf(2);
    String pageSize=String.valueOf(20);

    //http 调用逻辑
    Map<String, String> requestMap = new HashMap<>();
    requestMap.put("appId", appId);
    requestMap.put("timestamp", timestamp);
    requestMap.put("categoryId", categoryId);
    requestMap.put("watchStatus", watchStatus);
    requestMap.put("keyword", keyword);
    requestMap.put("page", page);
    requestMap.put("pageSize", pageSize);
    requestMap.put("sign", LiveSignUtil.getSign(requestMap, appSecret));
    String response = HttpUtil.postFormBody(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",
    "message":"",
    "data":{
        "pageSize":20,
        "pageNumber":1,
        "totalItems":1,
        "contents":[
            {
                "channelId":2191569,
                "name":"测试",
                "channelPasswd":"******",
                "categoryId":"345134",
                "scene":"ppt",
                "watchStatus":"playback",
                "watchStatusText":"回放中",
                "sceneText":"三分屏",
                "watchUrl":"https://live.polyv.cn/watch/2191569",
                "content":"这是直播介绍,可以是html代码",
                "startTime":1557888134000,
                "channelLogo":"//liveimages.videocc.net/uploaded/images/2021/03/fwzwkziu67.png",
                "splashImg":"//liveimages.videocc.net/uploaded/images/2021/03/fwzwkzkn9l.png",
                "splashEnabled":"Y",
                "publisher":"主持人名称",
                "authSetting":[
                    {
                        "channelId":2191569,
                        "rank":1,
                        "userId":"1b448be323",
                        "globalSettingEnabled":"N",
                        "enabled":"Y",
                        "authType":"external",
                        "authTips":"欢迎观看本次直播",
                        "payAuthTips":"欢迎观看本次直播",
                        "codeAuthTips":"欢迎观看本次直播",
                        "infoAuthTips":"欢迎观看本次直播",
                        "authCode":null,
                        "qcodeTips":null,
                        "qcodeImg":null,
                        "price":0,
                        "watchEndTime":null,
                        "validTimePeriod":null,
                        "customKey":"7020hnems4",
                        "customUri":null,
                        "externalKey":"L0EjokKI4O",
                        "externalUri":"http://demo.polyv.net/chenwb/live-validate.php",
                        "externalRedirectUri":null,
                        "directKey":"56221g3rv0",
                        "trialWatchEnabled":"N",
                        "trialWatchTime":null,
                        "trialWatchEndTime":null,
                        "whiteListInputTips":null,
                        "whiteListEntryText":"会员入口",
                        "infoDesc":null
                    },
                    {
                        "channelId":2191569,
                        "rank":2,
                        "userId":"1b448be323",
                        "globalSettingEnabled":"N",
                        "enabled":"N",
                        "authType":"none",
                        "authTips":"欢迎观看本次直播",
                        "payAuthTips":"欢迎观看本次直播",
                        "codeAuthTips":"欢迎观看本次直播",
                        "infoAuthTips":"欢迎观看本次直播",
                        "authCode":null,
                        "qcodeTips":null,
                        "qcodeImg":null,
                        "price":0,
                        "watchEndTime":null,
                        "validTimePeriod":null,
                        "customKey":"7020hnems4",
                        "customUri":null,
                        "externalKey":"9oh7qu8656",
                        "externalUri":null,
                        "externalRedirectUri":null,
                        "directKey":"56221g3rv0",
                        "trialWatchEnabled":"N",
                        "trialWatchTime":null,
                        "trialWatchEndTime":null,
                        "whiteListInputTips":null,
                        "whiteListEntryText":"会员入口",
                        "infoDesc":null
                    }
                ]
            }
        ],
        "startRow":1,
        "firstPage":true,
        "lastPage":true,
        "prePageNumber":1,
        "limit":1,
        "endRow":1,
        "totalPages":1,
        "nextPageNumber":1,
        "offset":0
    }
}
```

异常示例

```json
{
    "code": 400,
    "status": "error",
    "message": "invalid signature.",
    "data": ""
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://polyv.gitbook.io/document/docs/live/api/account/channel_detail.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
