# 分页获取转播子频道关联关系接口

### 接口URL

```
http://api.polyv.net/live/v3/channel/transmit/get-transmit-list
```

### 接口说明

```
1、分页获取频道转播子频道关联关系接口
2、支持分页，最大每页1000条数据，最小每页1条数据
3、接口支持https
```

### 支持格式

```
JSON
```

### 请求方式

```
GET
```

### 请求数限制

```
TRUE
```

### 请求参数

| 参数名       | 必选   | 类型     | 说明                                                                                                                                                                                                        |
| --------- | ---- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| appId     | 是    | string | 从API设置中获取，在直播系统登记的appId                                                                                                                                                                                   |
| timestamp | 是    | 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)】 |
| channelId | 是    | int    | 频道号                                                                                                                                                                                                       |
| page      | 否    | int    | 第几页，默认：1（第一页）                                                                                                                                                                                             |
| pageSize  | 否    | int    | 每页数据大小，默认每页10条数据，最大每页1000条数据，最小每页1条数据                                                                                                                                                                     |

### 响应成功JSON示例：

```json
{
    "code": 200,
    "status": "success",
    "message": "",
    "data": {
        "pageSize": 10,
        "pageNumber": 1,
        "totalItems": 3,
        "contents": [
            {
                "name": "888",
                "channelId": 2040976,
                "account": "0012040976",
                "passwd": "xxxxxx"
            },
            {
                "name": "接收转播频道01",
                "channelId": 2041139,
                "account": "0012041139",
                "passwd": "xxxxxx"
            },
            {
                "name": "接收转播频道02",
                "channelId": 2041140,
                "account": "0012041140",
                "passwd": "xxxxxx"
            }
        ],
        "startRow": 1,
        "firstPage": true,
        "lastPage": true,
        "prePageNumber": 1,
        "limit": 3,
        "totalPages": 1,
        "endRow": 3,
        "nextPageNumber": 1,
        "offset": 0
    }
}
```

### 响应失败JSON示例：

未输入appId

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

appId不正确

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

时间戳错误

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

签名错误

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

非法频道

```json
{
    "code": 403,
    "status": "error",
    "message": "illegal channel id: 1779742",
    "data": ""
}
```

非法参数

```json
{
    "code": 400,
    "status": "error",
    "message": "param is not digit: size",
    "data": ""
}
```

参数数值超出规定范围

```json
{
    "code": 400,
    "status": "error",
    "message": "number range error",
    "data": ""
}
```

### 字段说明

| 参数名                    | 类型      | 说明                                  |
| ---------------------- | ------- | ----------------------------------- |
| code                   | int     | 响应代码，成功为200，失败为400，签名错误为401，异常错误500 |
| status                 | string  | 成功为success，失败为error                 |
| message                | string  | 错误时为错误提示消息                          |
| data                   | object  | 响应结果集                               |
| pageNumber             | int     | 当前的页数                               |
| totalItems             | int     | 总的条数                                |
| contents               | array   | 查询的结果列表                             |
| contents\[0].name      | string  | 频道名称                                |
| contents\[0].channelId | int     | 频道号                                 |
| contents\[0].account   | string  | 助教账号                                |
| contents\[0].passwd    | string  | 频道密码                                |
| firstPage              | boolean | 是否为第一页，值为：true/false                |
| lastPage               | boolean | 是否为最后一页，值为：true/false               |
| nextPageNumber         | int     | 下一页编号                               |
| prePageNumber          | int     | 上一页编号                               |
| totalPages             | int     | 总页数                                 |
| startRow               | int     | 当前页第一个数量的位置                         |
| endRow                 | int     | 当前页最后一个数量的位置                        |
| limit                  | int     | 每页数量大小                              |

### Java请求示例

```java
public static void main(String[] args) {
        String url = "https://api.polyv.net/live/v3/channel/transmit/get-transmit-list";
        // 用户对应的appId和加密串
        String appId = "xxxxxxxxx";
        String appSecret = "xxxxxxxxxxxxxxxxxxxxxxxxxx";
        Map<String, String> params = new HashMap<>();
		params.put("channelId", "0000000");
		params.put("page", "1");
		params.put("pageSize", "10");
        PolyvTool.setLiveSign(params, appId, appSecret);
        // 调用Polyv的httpClient工具类发送请求
        String content = HttpClientUtil.getInstance()
                .sendHttpGet(url + "?" + PolyvTool.mapJoinNotEncode(params));
        System.out.println(content);
    }
```


---

# 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/unclassified/2020/1463904a53f903869e6e6ce251f31071.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.
