Polyv Help Center

Help Center

Query Thumbnail Information for All Channels

Updated: 2022-11-11 23:57:21

Legacy API endpoint Query Thumbnail Information for All Channels (Legacy)

API Description

1、查询账号下所有的频道缩略信息列表,观看页状态与新版后台一致
2、列表信息仅包含频道缩略信息,如需频道具体信息,请使用【获取频道信息】接口
3、接口支持https协议

API URL

http://api.polyv.net/live/v4/channel/simple/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 frequency limits. See details

Request Parameter Description

Parameter Required Type Description
appId true String Account appId See Get Secret Key
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 call the POLYV server through the customer's own server to obtain response data. See Signature Generation Rules
pageNumber false Integer Page number, defaults to 1
pageSize false Integer Number of items per page, defaults to 10, maximum cannot exceed 1000
categoryId false String Category ID
watchStatus false String Watch page status filter
live: Live
playback: Playback
end: Ended
waiting: Waiting
unStart: Not started
keyword false String Channel name, fuzzy search
orderBy false String Sort field, defaults to ascending by channel creation time
startTimeDesc: Descending by start time
startTimeAsc: Ascending by start time
channelCreatedTimeDesc: Descending by channel creation time

Example

http://api.polyv.net/live/v4/channel/simple/list?pageNumber=2&watchStatus=unStart&appId=frlr1zazn3&sign=A69559D6EBF130B9C0F60807459FC311&pageSize=3&categoryId=391352&timestamp=1642733791590

Response Parameter Description

Parameter Type Description
code Integer Status code, same as HTTP status code, used to determine the basic response status
status String Response result, determined by business logic. Returns success on success, error on failure
success Boolean Whether the response was successful
requestId String Request ID, a unique UUID generated for each request. Only for troubleshooting and debugging, should not be tied to business logic
error Object Error information when status code is not 200 See Error Field Description
data Object See data field description

Error Parameter Description

Parameter Type Description
code Integer Error code, used to identify the specific error reason
desc String Error description, corresponds to error.code

Data Parameter Description

Parameter Type Description
pageNumber Integer Current page number
pageSize Integer Number of items per page
totalPages Long Total number of pages
totalItems Long Total number of items
contents Array Content of the current page See contents field description

Contents Parameter Description

Parameter Type Description
channelId String Channel ID
name String Channel name
channelPasswd String Channel password
categoryId String Live broadcast category ID
scene String Scene
alone: Event live
ppt: Three-screen
topclass: Large class
seminar: Seminar
watchStatus String Watch page status description
Live
Playback
Ended
Waiting
Not started
Banned
watchStatusText String Watch page status
live: Live
playback: Playback
end: Ended
waiting: Waiting
unStart: Not started
banpush: Banned
sceneText String Scene description
watchUrl String Watch page URL

Java Request Example

For quick integration of basic code, please download the relevant dependency source code. Click here to download the source code. Add it to your own source project after downloading. HttpUtil.java and LiveSignUtil.java in the test cases are included 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 pools.

private static final Logger log = LoggerFactory.getLogger(ChannelOperateTest.class);
/**
 * 查询所有频道的缩略信息
 * @throws IOException
 * @throws NoSuchAlgorithmException
 */
@Test
public void testChannelSimpleList() 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/simple/list";
    String keyword = "测试";
    String categoryId = "391352";
    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("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
    
}

Response Example

For global system error descriptions, see Global Error Description

Success Example

{
    "code": 200,
    "status": "success",
    "requestId": "92a918d76e7246599d1aad24a253a470.1842.16427336349010109",
    "data": {
        "pageNumber": 2,
        "pageSize": 3,
        "totalPages": 2,
        "totalItems": 4,
        "contents": [
            {
                "channelId": 2775591,
                "name": "gateway 从入门到精通",
                "channelPasswd": "ZM0h81",
                "categoryId": 391352,
                "scene": "seminar",
                "newScene": "seminar",
                "template": "seminar",
                "watchStatus": "unStart",
                "watchStatusText": "未开始",
                "sceneText": "研讨会",
                "watchUrl": "https://live.polyv.cn/watch/2775591"
            }
        ]
    },
    "success": true
}

Error Example

{
    "code": 400,
    "status": "error",
    "error": {
        "code": 10003,
        "desc": "时间戳过期"
    },
    "success": false
}
联系客服,在线咨询
在线咨询