保利威文档中心

幫助中心

查詢頻道已上傳文件列表

更新時間:2022-12-12 11:51:12

接口描述

1、获取频道文档列表
2、接口支持https协议

接口URL

http://api.polyv.net/live/v3/channel/document/doc-list

線上API呼叫

請求方式

GET

接口限制

1、接口呼叫有頻率限制,詳細請查看

2、channelId和teacherId不能同時為空,若同時傳入且開啟了「講義庫」功能,則優先使用teacherId

請求參數說明

參數名 必填 類型 說明
appId true String 帳號appId【詳見取得密鑰
timestamp true Long 當前13位毫秒級時間戳,3分鐘內有效
sign true String 簽名,為32位大寫的MD5值【詳見簽名生成規則
channelId false String 頻道號,若開啟了「講義庫」功能,則查詢該頻道對應的講師所關聯的講義庫文件
status false String 文件狀態,預設不傳查詢所有
normal:正常
waitUpload:等待上傳
failUpload:上傳失敗
waitConvert:轉換PPT中
failConvert:轉換PPT失敗
page false Integer 第幾頁,預設不傳顯示第一頁
limit false Integer 每頁顯示幾筆資料,預設不傳顯示10筆
isShowUrl false String 是否顯示文件原始檔案地址,預設不傳不顯示
Y:是
N:否
teacherId false String 講師ID,若開啟了「講義庫」功能,則查詢講師關聯的講義庫文件,channelId和teacherId不能同時為空,若同時傳入且開啟了「講義庫」功能,則優先使用teacherId

範例

http://api.polyv.net/live/v3/channel/document/doc-list?isShowUrl=Y&appId=frlr1zazn3&limit=10&sign=8C73385047B8BADAE8DEB52318220A7E&page=1&channelId=1965681&timestamp=1621842982462&status=normal

響應參數說明

參數名 類型 說明
code Integer 響應狀態碼,200為成功返回,非200為失敗【詳見全域錯誤說明
status String 響應狀態文字資訊
message String 響應描述資訊,當code為400或500時,輔助描述錯誤原因
data Object 請求成功時為已上傳文件的相關資訊【詳見Data參數說明】,請求失敗時為空
Data參數說明
參數名 類型 說明
pageSize Integer 每頁資料大小,預設10,最大值1000
pageNumber Integer 當前的頁數
totalItems Integer 總筆數
contents Array 查詢的結果列表【詳見Contents參數說明
startRow Integer 當前頁第一筆記錄在總結果集中的位置
firstPage Boolean 是否為第一頁,值為:true/false
lastPage Boolean 是否為最後一頁,值為:true/false
prePageNumber Integer 上一頁編號
nextPageNumber Integer 下一頁編號
limit Integer 每頁數量大小
totalPages Integer 總頁數
endRow Integer 當前頁最後一筆記錄在總結果集中的位置
offset Integer 分頁起始記錄
Contents參數說明
參數名 類型 說明
fileId String 文件ID
fileName String 文件名
fileUrl String 文件url
fileType String 文件類型
totalPage Integer 上傳文件的內容總頁數
channelId String 頻道號
status String 文件狀態,不傳預設查詢所有
normal:正常
waitUpload:等待上傳
failUpload:上傳失敗
waitConvert:轉換PPT中
failConvert:轉換PPT失敗
createTime Long 建立時間,13位毫秒級時間戳
convertType String 轉換類型,預設不傳轉普通,因為只有ppt,pptx可以轉動畫,其他類型檔案會自動轉成普通;檔案轉動畫轉失敗會直接把類型轉為普通
common:轉普通圖片
animate:轉動畫效果
type String 類型,區分舊版PPT還是新版PPT
新版值為:new
舊版值為:old
previewImage String ppt預覽小圖地址
previewBigImage String ppt預覽大圖地址
autoId Integer 文件ID
teacherId String 講師ID

Java請求範例

快速接入基礎程式碼請下載相關依賴原始碼點擊下載原始碼 ,下載後加入到自己的原始碼工程中即可。測試案例中的HttpUtil.java 和 LiveSignUtil.java 都包含在下載檔案中。

強烈建議您使用直播Java SDK完成API的功能對接,直播Java SDK 對API呼叫邏輯、異常處理、資料簽名、HTTP請求執行緒池進行了統一封裝和最佳化。

private static final Logger log = LoggerFactory.getLogger(ChannelDocTest.class);
/**
 * 查询频道已上传文档列表
 * @throws IOException
 */
@Test
public void testGetDocList() 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/document/doc-list";
    String channelId = "1965681";
    String status = "normal";
    String limit = "5";
    String page = "1";
    String isShowUrl = "Y";

    //http 调用逻辑
    Map<String,String> requestMap = new HashMap<>();
    requestMap.put("appId", appId);
    requestMap.put("timestamp",timestamp);
    requestMap.put("channelId",channelId);
    requestMap.put("status",status);
    requestMap.put("limit",limit);
    requestMap.put("page",page);
    requestMap.put("isShowUrl",isShowUrl);
    requestMap.put("sign",LiveSignUtil.getSign(requestMap, appSecret));
    String response = HttpUtil.get(url, requestMap);
    log.info("测试查询频道已上传文档列表:{}",response);
    //do somethings

}

響應範例

系統全域錯誤說明詳見全域錯誤說明

成功範例

{
    "code":200,
    "status":"success",
    "message":"",
    "data":{
        "pageSize":10,
        "pageNumber":1,
        "totalItems":4,
        "contents":[
            {
                "autoId":1597852,
                "fileId":"5e74996c4f248ef2faa2f8fde168f1bf1965681common",
                "fileName":"直播指南1",
                "fileUrl":"http://doc-2.polyv.net/sources/20210114/5e74996c4f248ef2faa2f8fde168f1bf1965681common.pptx",
                "fileType":".pptx",
                "totalPage":19,
                "channelId":"1965681",
                "status":"normal",
                "createTime":1610616141000,
                "convertType":"common",
                "type":"new",
                "previewImage":"http://doc-2.polyv.net/images/2021/01/5e74996c4f248ef2faa2f8fde168f1bf1965681common/5e74996c4f248ef2faa2f8fde168f1bf1965681common_0000_s.jpeg",
                "previewBigImage":"http://doc-2.polyv.net/images/2021/01/5e74996c4f248ef2faa2f8fde168f1bf1965681common/5e74996c4f248ef2faa2f8fde168f1bf1965681common_0000.jpeg"
            },
            {
                "autoId":1504367,
                "fileId":"471bee13c7555deb16f44aad783a2aeb1965681common",
                "fileName":"直播指南2",
                "fileUrl":"http://doc-2.polyv.net/sources/20201106/471bee13c7555deb16f44aad783a2aeb1965681common.pptx",
                "fileType":".pptx",
                "totalPage":18,
                "channelId":"1965681",
                "status":"normal",
                "createTime":1604633378000,
                "convertType":"common",
                "type":"new",
                "previewImage":"http://doc-2.polyv.net/images/2020/11/471bee13c7555deb16f44aad783a2aeb1965681common/471bee13c7555deb16f44aad783a2aeb1965681common_0000_s.jpeg",
                "previewBigImage":"http://doc-2.polyv.net/images/2020/11/471bee13c7555deb16f44aad783a2aeb1965681common/471bee13c7555deb16f44aad783a2aeb1965681common_0000.jpeg"
            },
            {
                "autoId":1485063,
                "fileId":"6e0603f6c8ec6113b87f69a7191d22021965681common",
                "fileName":"培训课程表.docx",
                "fileUrl":"http://doc-2.polyv.net/sources/20201020/6e0603f6c8ec6113b87f69a7191d22021965681common.docx",
                "fileType":".docx",
                "totalPage":1,
                "channelId":"1965681",
                "status":"normal",
                "createTime":1603182016000,
                "convertType":"common",
                "type":"new",
                "previewImage":"http://doc-2.polyv.net/images/2020/10/6e0603f6c8ec6113b87f69a7191d22021965681common/6e0603f6c8ec6113b87f69a7191d22021965681common_0000_s.jpeg",
                "previewBigImage":"http://doc-2.polyv.net/images/2020/10/6e0603f6c8ec6113b87f69a7191d22021965681common/6e0603f6c8ec6113b87f69a7191d22021965681common_0000.jpeg"
            },
            {
                "autoId":1484687,
                "fileId":"c2d585857870f4eff024976e3a265c0b1965681common",
                "fileName":"课程表.docx",
                "fileUrl":"http://doc-2.polyv.net/sources/20201020/c2d585857870f4eff024976e3a265c0b1965681common.docx",
                "fileType":".docx",
                "totalPage":1,
                "channelId":"1965681",
                "status":"normal",
                "createTime":1603163842000,
                "convertType":"common",
                "type":"new",
                "previewImage":"http://doc-2.polyv.net/images/2020/10/c2d585857870f4eff024976e3a265c0b1965681common/c2d585857870f4eff024976e3a265c0b1965681common_0000_s.jpeg",
                "previewBigImage":"http://doc-2.polyv.net/images/2020/10/c2d585857870f4eff024976e3a265c0b1965681common/c2d585857870f4eff024976e3a265c0b1965681common_0000.jpeg"
            }
        ],
        "startRow":1,
        "firstPage":true,
        "lastPage":true,
        "prePageNumber":1,
        "limit":4,
        "offset":0,
        "totalPages":1,
        "endRow":4,
        "nextPageNumber":1
    }
}

異常範例

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