Polyv Help Center

Help Center

Paginated Query of Channels That Can Be Set to Receive Rebroadcasts

Updated: 2024-09-27 15:54:14

API Description

1、通过一个(发起转播的)频道分页查询能够被它设置接收转播的频道列表
2、接口支持https协议

API URL

http://api.polyv.net/live/v3/channel/basic/receive/list

Online API Call

Request Method

GET

API Constraints

  1. The API supports both HTTP and HTTPS. HTTPS is recommended for security. API calls have a frequency limit. See details

Request Parameter Description

Parameter Required Type Description
appId true String Account appId See details on obtaining keys
timestamp true Long Current 13-digit millisecond timestamp, valid for 3 minutes
sign true String Signature, a 32-character uppercase MD5 value. The appSecret key used to generate the signature is critical for communication data security. It must not be stored or used directly on the client. All APIs must be called through the customer's own server to relay requests to the POLYV server for response data. See signature generation rules
channelId true String (Source channel for rebroadcasting) Channel ID
keyword false String Channel name, supports fuzzy search
page false Integer Page number for query, default is 1
pageSize false Integer Number of items per page, default is 10

Example

http://api.polyv.net/live/v3/channel/basic/receive/list?appId=frlr1zazn3&sign=56C6413F1606D8950C0BCE2AEC7CD456&channelId=2788479&timestamp=1642493607445

Response Parameter Description

Parameter Type Description
code Integer Response status code, 200 for success, non-200 for failure See global error description
status String Response status text
message String Response description, provides error details when code is 400 or 500
data Object Empty on failure; on success, returns basic channel information for the entire account See data parameter description

Data Parameter Description

Parameter Type Description
pageSize Integer Number of items per page, default 20, max 20
pageNumber Integer Current page number
totalItems Integer Total number of items
contents Array Query result list See Contents parameter description
startRow Integer Position of the first record on the current page in the total result set
firstPage Boolean Whether it is the first page, values: true/false, default false
lastPage Boolean Whether it is the last page, values: true/false, default false
prePageNumber Integer Previous page number
limit Integer Number of items per page
nextPageNumber Integer Next page number
endRow Integer Position of the last record on the current page in the total result set
totalPages Integer Total number of pages
offset Integer Pagination starting record

Contents Parameter Description

Parameter Type Description
channelId String Channel ID
name String Channel name
channelPasswd String Channel password, used for non-seminar scenarios
hostPasswd String Seminar host password, used for seminar scenarios
attendeePasswd String Seminar attendee password, used for seminar scenarios
categoryName String Channel category name
authType String Viewing conditions, separated by commas, e.g., none,none
none: No conditions,
pay: Paid viewing,
code: Verification code viewing,
phone: Whitelist viewing,
info: Registration viewing,
custom: Custom authorization viewing,
external: External authorization,
direct: Direct authorization
recentViewCount Integer Number of viewers in the most recent session
subChannelAccount String First sub-channel ID, null if no sub-channel exists
subChannelPasswd String First sub-channel password, null if no sub-channel exists
startTime String Live broadcast start time
transmitChannelId String Associated rebroadcast channel ID, null if not associated
scene String Scene
alone: Event live streaming
ppt: Three-screen
topclass: Large class

Java Request Example

For quick integration of basic code, please download the relevant dependency source code. Click here to download the source code. After downloading, add it to your own source code project. The test cases include HttpUtil.java and LiveSignUtil.java in the downloaded file.

It is strongly recommended to use the Live Java SDK for API integration. The Live Java SDK provides unified encapsulation and optimization for API call logic, exception handling, data signing, and HTTP request thread pooling.

    @Test
    public void testGetReceiveList() throws IOException, NoSuchAlgorithmException {
        //公共参数,填写自己的实际参数
        String appId = super.appId;
        String appSecret = super.appSecret;
        String timestamp = String.valueOf(System.currentTimeMillis());
        
        //业务参数
        String channelId = "2788479";
        String url = "http://api.polyv.net/live/v3/channel/basic/receive/list";
        
        //http 调用逻辑
        Map<String, String> requestMap = new HashMap<>();
        requestMap.put("appId", appId);
        requestMap.put("timestamp", timestamp);
        requestMap.put("channelId", channelId);
        //requestMap.put("keyword","");
        //requestMap.put("page","");
        //requestMap.put("pageSize","");
        requestMap.put("sign", LiveSignUtil.getSign(requestMap, appSecret));
        url = MapUtil.appendUrl(url, requestMap);
        String response = HttpUtil.get(url, null);
        log.info("测试分页查询频道可设置接收转播频道列表接口返回值:{}", response);
    }

Response Example

For global error descriptions, see Global Error Description

Success Example

{
    "code": 200,
    "status": "success",
    "message": "",
    "data": {
        "pageSize": 10,
        "pageNumber": 1,
        "totalItems": 1,
        "contents": [
            {
                "channelId": 1972965,
                "name": "Spring 知识精讲",
                "passwd": null,
                "hostPasswd": null,
                "attendeePasswd": null,
                "categoryName": "默认分类",
                "authType": "none,none",
                "status": 7,
                "recentViewCount": 0,
                "subChannelAccount": null,
                "subChannelPasswd": null,
                "watchUrl": null,
                "watchQRCodeUrl": null,
                "scene": "alone",
                "type": "receive",
                "startTime": null,
                "guest": null,
                "pureRtcEnabled": "N",
                "transmitType": "single",
                "multipleRoom": null,
                "creatorChildId": null,
                "creatorName": null,
                "rtcType": "agora",
                "transmitChannelId": null,
                "channelPasswd": "3I85nJ"
            }
        ],
        "offset": 0,
        "limit": 1,
        "nextPageNumber": 1,
        "totalPages": 1,
        "endRow": 1,
        "startRow": 1,
        "firstPage": true,
        "lastPage": true,
        "prePageNumber": 1
    }
}

Error Example

{
    "code": 403,
    "status": "error",
    "message": "invalid signature.",
    "data": ""
}
联系客服,在线咨询
在线咨询