保利威文档中心

幫助中心

取得播放清單資訊

更新時間:2022-05-23 19:02:59

介面URL

https://api.polyv.net/v2/play-list/list

介面說明

取得播放清單資訊

支援格式

JSON

請求方式

GET

請求參數

參數名 必選 類型及範圍 說明
userid string 使用者ID
ptime long 目前時間的毫秒級時間戳(13位),3分鐘內有效
sign String 簽名,為40位大寫的SHA1值【詳見簽名生成規則
playListIds string 播放清單ID,多個以英文逗號分隔,最大1000個,如"1620153765497,1620142496099"
title string 標題,按標題模糊搜尋
page int 目前頁碼,預設為1
pageSize int 每頁大小,最大1000筆,預設為10

返回正確結果JSON範例

{
    "code": 200,
    "status": "success",
    "message": "success",
    "data": {
        "pageNumber": 1,
        "totalPages": 1,
        "pageSize": 10,
        "contents": [
            {
                "id": 1620142496099,
                "description": "播放列表描述",
                "tag": "播放列表标签",
                "title": "播放列表标题",
                "creationTime": 1620142496099,
                "updateTime": 1620208243903,
                "videoCount": 2,
                "videoList": [
                    {
                        "vid": "a2dc4f2517d7a3b462dc1876c333fd32",
                        "title": "视频标题",
                        "duration": 732.0,
                        "coverURL": "http://img.videocc.net/uimage/a/a2dc4f2517/first_image/9b16020e-c3f7-4b0d-9c55-ba5171eb7857_s.png",
                    }
                ]
            }
        ],
        "totalItems": 1
    }
}

返回錯誤結果JSON範例

签名不正确
{
    "code":400,
    "status":"error",
    "message":"the sign is not right",
    "data":""
}
时间戳过期
{
    "code":400,
    "status":"error",
    "message":"ptime is too old.",
    "data":""
}

欄位說明

欄位 類型 說明
code int 回傳碼
status string 回傳狀態
message string 回傳資訊
data object 操作結果
pageNumber int 頁碼
totalPages int 總頁數
pageSize int 每頁大小
totalItems int 總數
contents array 分頁資料
id long 播放清單ID
description string 播放清單描述資訊
tag string 播放清單標籤
title string 播放清單標題
creationTime long 播放清單建立時間,13位毫秒時間戳
updateTime long 播放清單最近更新時間,13位毫秒時間戳
videoCount int 播放清單的影片數量
videoList array 播放清單的影片陣列
vid string 影片vid
videoList.title string 影片標題
duration float 影片時長,單位:秒
coverURL string 影片首圖url

java請求範例:

    public void testGetPlayList() throws Exception {
        String url = "https://api.polyv.net/v2/play/list";
        Map<String, String> params = new HashMap<>();
        params.put("userid", userid);
        params.put("ptime", String.valueOf(System.currentTimeMillis()));
        params.put("sign", getSign(params, secretkey));
        String response = HttpClientUtil.getInstance().sendHttpGet(url + "?" + PolyvTool.mapJoinNotEncode(params));
        System.out.println(response);
    }
联系客服,在线咨询