Polyv Help Center

Help Center

Query Channel Uploaded Document List

Updated: 2022-12-12 11:51:12

API Description

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

API URL

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

Online API Call

Request Method

GET

API Constraints

  1. API calls have a frequency limit. See details

  2. channelId and teacherId cannot both be empty. If both are provided and the "Handout Library" feature is enabled, teacherId takes precedence.

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 for 3 minutes
sign true String Signature, a 32-character uppercase MD5 value See details in Signature Generation Rules
channelId false String Channel ID. If the "Handout Library" feature is enabled, queries the handout library documents associated with the channel's lecturer.
status false String Document status. Default: query all if not provided.
normal: Normal
waitUpload: Waiting to upload
failUpload: Upload failed
waitConvert: Converting PPT
failConvert: PPT conversion failed
page false Integer Page number. Default: first page if not provided.
limit false Integer Number of records per page. Default: 10 if not provided.
isShowUrl false String Whether to display the original file URL. Default: not displayed if not provided.
Y: Yes
N: No
teacherId false String Lecturer ID. If the "Handout Library" feature is enabled, queries the handout library documents associated with the lecturer. channelId and teacherId cannot both be empty. If both are provided and the "Handout Library" feature is enabled, teacherId takes precedence.

Example

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

Response Parameter Description

Parameter Type Description
code Integer Response status code. 200 indicates success, non-200 indicates failure See details in Global Error Description
status String Response status text
message String Response description. When code is 400 or 500, provides auxiliary error reason.
data Object Information about uploaded documents on success See details in Data Parameter Description, empty on failure.
Data Parameter Description
Parameter Type Description
pageSize Integer Number of records per page. Default: 10, maximum: 1000
pageNumber Integer Current page number
totalItems Integer Total number of records
contents Array Query result list See details in 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
lastPage Boolean Whether it is the last page. Values: true/false
prePageNumber Integer Previous page number
nextPageNumber Integer Next page number
limit Integer Number of records per page
totalPages Integer Total number of pages
endRow Integer Position of the last record on the current page in the total result set
offset Integer Pagination starting record
Contents Parameter Description
Parameter Type Description
fileId String File ID
fileName String File name
fileUrl String File URL
fileType String File type
totalPage Integer Total number of pages in the uploaded document
channelId String Channel ID
status String Document status. Default: query all if not provided.
normal: Normal
waitUpload: Waiting to upload
failUpload: Upload failed
waitConvert: Converting PPT
failConvert: PPT conversion failed
createTime Long Creation time, 13-digit millisecond timestamp
convertType String Conversion type. Default: convert to normal if not provided. Only ppt, pptx can be converted to animation; other file types are automatically converted to normal. If animation conversion fails, the type is automatically changed to normal.
common: Convert to normal image
animate: Convert to animation effect
type String Type, distinguishes between old and new PPT versions.
New version value: new
Old version value: old
previewImage String PPT preview small image URL
previewBigImage String PPT preview large image URL
autoId Integer Document ID
teacherId String Lecturer ID

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. 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 functionality 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(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

}

Response Example

For system-wide global error descriptions, see Global Error Description

Success Example

{
    "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
    }
}

Error Example

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