查詢所有頻道的詳細資訊
更新時間:2025-06-12 18:59:44
舊版介面位址查詢所有頻道的詳細資訊(舊版)
介面描述
1、查询账号下所有频道详细信息列表,观看页状态与新版后台一致
2、接口支持https协议
介面URL
http://api.polyv.net/live/v4/channel/detail/list
請求方式
GET
介面限制
1、介面同時支援HTTP、HTTPS,建議使用HTTPS以確保介面安全,介面呼叫有頻率限制,詳細請查看
請求參數描述
| 參數名 | 必選 | 類型 | 說明 |
|---|---|---|---|
| appId | true | String | 帳號appId【詳見取得金鑰】 |
| timestamp | true | Long | 當前13位毫秒級時間戳,3分鐘內有效 |
| sign | true | String | 簽名,為32位大寫的MD5值,產生簽名的appSecret金鑰作為通訊資料安全的關鍵資訊,嚴禁儲存在用戶端直接使用,所有API都必須透過客戶自己伺服器中轉呼叫POLYV伺服器取得回應資料【詳見簽名產生規則】 |
| pageNumber | false | Integer | 頁數預設為1 |
| pageSize | false | Integer | 每頁顯示的資料筆數,預設每頁顯示10筆資料,最大值不得超過1000 |
| categoryId | false | String | 所屬分類ID |
| watchStatus | false | String | 觀看頁狀態篩選 live:直播中 playback:回放中 end:已結束 waiting:等待中 unStart:未開始 |
| keyword | false | String | 頻道名稱,模糊查詢 |
| orderBy | false | String | 排序欄位,預設按頻道建立時間升序 startTimeDesc:開播時間降序 startTimeAsc:開播時間升序 channelCreatedTimeDesc:頻道建立時間降序 |
範例
http://api.polyv.net/live/v4/channel/detail/list?pageNumber=2&watchStatus=unStart&appId=frlr1zazn3&sign=49428741C1D7BEE8BE1EE545F066ECC7&pageSize=3&keyword=%E6%B5%8B%E8%AF%95&categoryId=340019×tamp=1642734850008
回應參數描述
| 參數名 | 類型 | 說明 |
|---|---|---|
| code | Integer | 狀態碼,與http狀態碼相同,用於確定基本的回應狀態 |
| status | String | 回應結果,由業務決定,成功回傳success,失敗回傳error |
| success | Boolean | 是否成功回應 |
| requestId | String | 請求ID,每次請求產生的唯一UUID,僅可用於排查、除錯,不應與業務掛鉤 |
| error | Object | 狀態碼非200時的錯誤資訊【詳見Error欄位描述】 |
| data | Object | 【詳見data欄位說明】 |
Error參數描述
| 參數名 | 類型 | 說明 |
|---|---|---|
| code | Integer | 錯誤代碼,用於確定具體的錯誤原因 |
| desc | String | 錯誤描述,與error.code對應 |
Data參數描述
| 參數名 | 類型 | 說明 |
|---|---|---|
| pageNumber | Integer | 當前頁碼 |
| pageSize | Integer | 每頁資料量 |
| totalPages | Long | 頁面總數 |
| totalItems | Long | 總資料量 |
| contents | Array | 當前頁內容【詳見contents欄位說明】 |
Contents參數描述
| 參數名 | 類型 | 說明 |
|---|---|---|
| channelId | String | 頻道號 |
| name | String | 頻道名稱 |
| channelPasswd | String | 頻道密碼 |
| categoryId | String | 分類ID |
| scene | String | 場景 alone:活動直播 ppt:三分屏 topclass:大班課 seminar:研討會 |
| newScene | String | 新版後台直播場景,若未定義則取scene undefined:未定義 topclass:大班課 double:雙師課(需開通權限) train:企業培訓 seminar:研討會 alone:活動行銷 |
| template | String | 新版後台直播模板,若為舊版頻道,該欄位為未定義 undefined:未定義 ppt-三分屏(橫屏) portrait_ppt-三分屏(豎屏) alone-純影片(橫屏) portrait_alone-純影片(豎屏) topclass-純影片-極速(橫屏) portrait_topclass-純影片-極速(豎屏) seminar-研討會 |
| watchStatus | String | 觀看頁狀態 live:直播中 playback:回放中 end:已結束 waiting:等待中 unStart:未開始 banpush:已禁播 |
| watchStatusText | String | 觀看頁狀態描述,直播中,回放中,已結束,等待中,未開始,已禁播 |
| sceneText | String | 場景描述 |
| watchUrl | String | 觀看頁連結 |
| content | String | 直播介紹 |
| startTime | Long | 直播開始時間,13位毫秒級時間戳 |
| pureRtcEnabled | String | 直播延遲 Y無延遲 N普通延遲 |
| channelLogo | String | 頻道圖示 |
| splashImg | String | 頻道引導圖 |
| splashEnabled | String | 引導頁開關 Y:開啟 N:關閉 |
| publisher | String | 主持人名稱 |
| authSetting | Array | 觀看條件設定【詳見authSetting參數描述】 |
| streamType | String | 直播方式. client: 使用開播端或第三方推流(常規); disk: 偽直播; |
authSetting參數描述
| 參數名 | 類型 | 說明 |
|---|---|---|
| channelId | String | 頻道號 |
| rank | Integer | 用於實現一個頻道設定兩個觀看條件,為1或2 1:主要條件 2:次要條件 |
| userId | String | POLYV用戶ID,與保利威官網一致,取得路徑:官網->登入->直播(開發設定) |
| globalSettingEnabled | String | 是否開啟全域設定 Y:開啟 N:關閉 |
| enabled | String | 是否開啟觀看條件 Y:開啟 N:關閉 |
| authType | String | 觀看條件類型 none:無限制 code:驗證碼觀看 pay:付費觀看 phone:白名單觀看 info:登記觀看 wxshare:分享觀看 custom:自訂授權觀看 external:外部授權觀看 |
| payAuthTips | String | 付費觀看提示資訊 |
| price | Float | 付費觀看的價格 |
| watchEndTime | Long | 付費觀看,截止時間,13位毫秒級時間戳,為null表示:一次付費,永久有效 |
| validTimePeriod | Integer | 付費觀看的截止時長(天) |
| infoAuthTips | String | 登記觀看提示資訊 |
| infoDesc | String | 登記觀看的描述欄位 |
| codeAuthTips | String | 驗證碼觀看提示資訊 |
| authCode | String | 驗證碼觀看的驗證碼 |
| qcodeTips | String | 驗證碼觀看的QR Code提示 |
| qcodeImg | String | 驗證碼觀看的QR Code圖片 |
| customKey | String | 自訂授權觀看的key |
| customUri | String | 自訂授權觀看的介面位址 |
| externalKey | String | 外部授權觀看的key |
| externalUri | String | 外部授權觀看的介面位址 |
| externalRedirectUri | String | 外部授權觀看,用戶直接存取觀看頁時的跳轉位址 |
| directKey | String | 獨立授權key |
| trialWatchEnabled | String | 試看開關 Y:開啟試看 N:關閉試看 |
| trialWatchTime | Integer | 試看時間,單位為分鐘 |
| trialWatchEndTime | Long | 試看截止日期,13位毫秒級時間戳,為null表示對該頻道永久有效 |
| authTips | String | 白名單觀看提示資訊 |
| whiteListInputTips | String | 白名單輸入提示 |
| whiteListEntryText | String | 白名單入口文案 |
Java請求範例
快速接入基礎程式碼請下載相關依賴原始碼, 點擊下載原始碼 ,下載後加入到自己的原始碼工程中即可。測試案例中的HttpUtil.java 和 LiveSignUtil.java 都包含在下載檔案中。
強烈建議您使用直播Java SDK完成API的功能對接,直播Java SDK對API呼叫邏輯、異常處理、資料簽名、HTTP請求執行緒池進行了統一封裝和最佳化。
private static final Logger log = LoggerFactory.getLogger(ChannelOperateTest.class);
/**
* 查询所有频道的详细信息
* @throws IOException
* @throws NoSuchAlgorithmException
*/
@Test
public void testChannelDetailList() 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/detail/list";
String keyword = "测试";
String categoryId = "340019";
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("keyword", keyword);
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
}
回應範例
系統全域錯誤說明詳見全域錯誤說明
成功範例
{
"code": 200,
"status": "success",
"requestId": "11208b877f3543af8b0e65a393031027.64.16427348530723753",
"data": {
"pageNumber": 2,
"pageSize": 3,
"totalPages": 2,
"totalItems": 5,
"contents": [
{
"channelId": 2779045,
"name": "测试",
"channelPasswd": "6dMuVz",
"categoryId": 340019,
"scene": "alone",
"newScene": "alone",
"template": "portrait_alone",
"watchStatus": "unStart",
"watchStatusText": "未开始",
"sceneText": "纯视频(专业)",
"watchUrl": "https://live.polyv.cn/watch/2779045",
"content": "",
"startTime": null,
"pureRtcEnabled": "N",
"channelLogo": "//liveimages.videocc.net/assets/wimages/pc_images/logo.png",
"splashImg": "//liveimages.videocc.net/uploaded/images/2021/09/g2bta2pjbw.jpg",
"splashEnabled": "Y",
"publisher": "主持人",
"authSetting": [
{
"channelId": 2779045,
"userId": "1b448be323",
"rank": 1,
"globalSettingEnabled": "N",
"enabled": "N",
"authType": "external",
"authTips": "欢迎观看本次直播",
"payAuthTips": "欢迎观看本次直播",
"codeAuthTips": "欢迎观看本次直播",
"infoAuthTips": "欢迎观看本次直播",
"authCode": "",
"qcodeTips": null,
"qcodeImg": null,
"price": 0.01,
"watchEndTime": null,
"validTimePeriod": null,
"customKey": "ujpTIPloEw",
"customUri": "",
"externalKey": "ujpTIPloEw",
"externalUri": "http://www.polyv.net",
"externalRedirectUri": "",
"externalEntryText": "登录观看",
"directKey": "ujpTIPloEw",
"trialWatchEnabled": "N",
"trialWatchTime": 1,
"trialWatchEndTime": null,
"whiteListInputTips": "请输入会员码-1605067278063",
"whiteListEntryText": "会员入口",
"infoDesc": ""
},
{
"channelId": 2779045,
"userId": "1b448be323",
"rank": 2,
"globalSettingEnabled": "N",
"enabled": "N",
"authType": "none",
"authTips": "欢迎观看本次直播",
"payAuthTips": "欢迎观看本次直播",
"codeAuthTips": "欢迎观看本次直播",
"infoAuthTips": "欢迎观看本次直播",
"authCode": null,
"qcodeTips": null,
"qcodeImg": null,
"price": 0,
"watchEndTime": null,
"validTimePeriod": null,
"customKey": "ujpTIPloEw",
"customUri": null,
"externalKey": "ujpTIPloEw",
"externalUri": null,
"externalRedirectUri": null,
"externalEntryText": "",
"directKey": "ujpTIPloEw",
"trialWatchEnabled": "N",
"trialWatchTime": null,
"trialWatchEndTime": null,
"whiteListInputTips": null,
"whiteListEntryText": "会员入口",
"infoDesc": null
}
]
},
{
"channelId": 2779196,
"name": "测试",
"channelPasswd": "6dMuVz",
"categoryId": 340019,
"scene": "alone",
"newScene": "alone",
"template": "portrait_alone",
"watchStatus": "unStart",
"watchStatusText": "未开始",
"sceneText": "纯视频(专业)",
"watchUrl": "https://live.polyv.cn/watch/2779196",
"content": "",
"startTime": 1642453440000,
"pureRtcEnabled": "N",
"channelLogo": "//liveimages.videocc.net/assets/wimages/pc_images/logo.png",
"splashImg": "//liveimages.videocc.net/uploaded/images/2021/09/g2bta2pjbw.jpg",
"splashEnabled": "Y",
"publisher": "主持人",
"authSetting": [
{
"channelId": 2779196,
"userId": "1b448be323",
"rank": 1,
"globalSettingEnabled": "N",
"enabled": "N",
"authType": "external",
"authTips": "欢迎观看本次直播",
"payAuthTips": "欢迎观看本次直播",
"codeAuthTips": "欢迎观看本次直播",
"infoAuthTips": "欢迎观看本次直播",
"authCode": "",
"qcodeTips": null,
"qcodeImg": null,
"price": 0.01,
"watchEndTime": null,
"validTimePeriod": null,
"customKey": "ujpTIPloEw",
"customUri": "",
"externalKey": "ujpTIPloEw",
"externalUri": "http://www.polyv.net",
"externalRedirectUri": "",
"externalEntryText": "登录观看",
"directKey": "ujpTIPloEw",
"trialWatchEnabled": "N",
"trialWatchTime": 1,
"trialWatchEndTime": null,
"whiteListInputTips": "请输入会员码-1605067278063",
"whiteListEntryText": "会员入口",
"infoDesc": ""
},
{
"channelId": 2779196,
"userId": "1b448be323",
"rank": 2,
"globalSettingEnabled": "N",
"enabled": "N",
"authType": "none",
"authTips": "欢迎观看本次直播",
"payAuthTips": "欢迎观看本次直播",
"codeAuthTips": "欢迎观看本次直播",
"infoAuthTips": "欢迎观看本次直播",
"authCode": null,
"qcodeTips": null,
"qcodeImg": null,
"price": 0,
"watchEndTime": null,
"validTimePeriod": null,
"customKey": "ujpTIPloEw",
"customUri": null,
"externalKey": "ujpTIPloEw",
"externalUri": null,
"externalRedirectUri": null,
"externalEntryText": "",
"directKey": "ujpTIPloEw",
"trialWatchEnabled": "N",
"trialWatchTime": null,
"trialWatchEndTime": null,
"whiteListInputTips": null,
"whiteListEntryText": "会员入口",
"infoDesc": null
}
]
}
]
},
"success": true
}
異常範例
{
"code": 400,
"status": "error",
"error": {
"code": 10003,
"desc": "时间戳过期"
},
"success": false
}
