Query Detailed Information of All Channels
Updated: 2024-12-16 19:20:19
Interface Description
1、查询账号下所有频道详细信息列表
2、接口支持https协议
API URL
http://api.polyv.net/live/v3/channel/management/list-detail
Request Method
POST
Interface Constraints
- The interface supports both HTTP and HTTPS. HTTPS is recommended to ensure interface security. Interface calls are subject to frequency limits. For details, please refer to
Request Parameter Description
| Parameter | Required | Type | Description |
|---|---|---|---|
| appId | true | String | Account appId See details in Get Secret Key |
| timestamp | true | Long | Current 13-digit millisecond timestamp, valid within 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 never be saved or used directly on the client side. All APIs must be called through the customer's own server to relay requests to the POLYV server and retrieve response data. See details in Signature Generation Rules |
| page | false | Integer | Page number, defaults to 1 |
| pageSize | false | Integer | Number of data items per page, defaults to 20 |
| categoryId | false | String | Category ID |
| watchStatus | false | String | Watch page status filter live: Live playback: Playback end: Ended waiting: Waiting |
| keyword | false | String | Channel name, fuzzy search |
Example
http://api.polyv.net/live/v3/channel/management/list-detail
Form parameters:
watchStatus=playback&appId=frlr1zazn3&sign=BDEE4A11F8720DC0FD40E33DE159536B&pageSize=20&page=1&keyword=%E6%B5%8B%E8%AF%95&categoryId=345134×tamp=1621841244430
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 information |
| message | String | Response description message, when code is 400 or 500, it provides auxiliary description of the error cause |
| data | Object | Returns channel details upon successful response [see data field description] |
Data Parameter Description
| Parameter Name | Type | Description |
|---|---|---|
| pageSize | Integer | Number of data items per page, default is 20 |
| pageNumber | Integer | Current page number |
| totalItems | Integer | Total number of items |
| contents | Array | Detailed list of channels [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, value: true/false, default is false |
| lastPage | Boolean | Whether it is the last page, value: true/false, default is false |
| prePageNumber | Integer | Previous page number |
| limit | Integer | Number of items per page |
| totalPages | Integer | Total number of pages |
| endRow | Integer | Position of the last record on the current page in the total result set |
| nextPageNumber | Integer | Next page number |
| offset | Integer | Pagination starting record |
Contents Parameter Description
| Parameter | Type | Description |
|---|---|---|
| channelId | String | Channel ID |
| name | String | Channel name |
| channelPasswd | String | Channel password |
| categoryId | String | Category ID |
| scene | String | Scene alone: Live event ppt: Three-screen split topclass: Large class seminar: Seminar |
| watchStatus | String | Watch page status live: Live playback: Playback end: Ended waiting: Waiting |
| watchStatusText | String | Watch page status description: Live, Playback, Ended, Waiting |
| sceneText | String | Scene description |
| watchUrl | String | Watch page link |
| content | String | Live stream description |
| startTime | Long | Live stream start time, 13-digit millisecond timestamp |
| channelLogo | String | Channel icon |
| splashImg | String | Channel splash image |
| splashEnabled | String | Splash page toggle Y: Enabled N: Disabled |
| publisher | String | Host name |
| authSetting | Array | Watch condition settings [See authSetting parameter description] |
authSetting Parameter Description
| Parameter Name | Type | Description |
|---|---|---|
| channelId | String | Channel ID |
| rank | Integer | Used to set two viewing conditions for a channel, value is 1 or 2 1: Primary condition 2: Secondary condition |
| userId | String | POLYV user ID, consistent with the official website. Retrieval path: Official website -> Login -> Live Streaming (Development Settings) |
| globalSettingEnabled | String | Whether to enable global settings Y: Enabled N: Disabled |
| enabled | String | Whether to enable viewing conditions Y: Enabled N: Disabled |
| authType | String | Viewing condition type none: No restrictions code: Verification code viewing pay: Paid viewing phone: Whitelist viewing info: Registration viewing wxshare: Share viewing custom: Custom authorization viewing external: External authorization viewing |
| payAuthTips | String | Paid viewing prompt message |
| price | Float | Price for paid viewing |
| watchEndTime | Long | Paid viewing deadline, 13-digit millisecond timestamp. null means: one-time payment, permanently valid |
| validTimePeriod | Integer | Duration of paid viewing validity (days) |
| infoAuthTips | String | Registration viewing prompt message |
| infoDesc | String | Description field for registration viewing |
| codeAuthTips | String | Verification code viewing prompt message |
| authCode | String | Verification code for verification code viewing |
| qcodeTips | String | QR code prompt for verification code viewing |
| qcodeImg | String | QR code image for verification code viewing |
| customKey | String | Key for custom authorization viewing |
| customUri | String | Interface address for custom authorization viewing |
| externalKey | String | Key for external authorization viewing |
| externalUri | String | Interface address for external authorization viewing |
| externalRedirectUri | String | Redirect URL for external authorization viewing when users directly access the viewing page |
| directKey | String | Independent authorization key |
| trialWatchEnabled | String | Trial watch toggle Y: Enable trial watch N: Disable trial watch |
| trialWatchTime | Integer | Trial watch duration, in minutes |
| trialWatchEndTime | Long | Trial watch deadline, 13-digit millisecond timestamp. null means permanently valid for this channel |
| authTips | String | Whitelist viewing prompt message |
| whiteListInputTips | String | Whitelist input prompt |
| whiteListEntryText | String | Whitelist entry text |
Java Request Example
For quick integration of the 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 HttpUtil.java and LiveSignUtil.java are both included in the downloaded file.
It is strongly recommended that you use the Live Java SDK to complete the API functionality integration. The Live Java SDK provides a unified encapsulation and optimization for API call logic, exception handling, data signing, and HTTP request thread pooling.
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
}
Response Example
For a detailed explanation of system-wide errors, please refer to the Global Error Description.
Successful Example
{
"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.ipolyv.cn/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
}
}
Error Example
{
"code": 400,
"status": "error",
"message": "invalid signature.",
"data": ""
}
