Polyv Help Center

Help Center

Create Playlist

Updated: 2022-05-23 19:02:59

API URL

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

API Description

Create a playlist

Supported Format

JSON

Request Method

POST

Request Parameters

Parameter Required Type & Scope Description
userid Yes string User ID
ptime Yes long Current time in milliseconds (13 digits), valid for 3 minutes
sign Yes String Signature, a 40-character uppercase SHA1 value See signature generation rules
title Yes string Title
description No string Description
tag No string Tag

Example of Successful JSON Response

{
    "code": 200,
    "status": "success",
    "message": "success",
    "data": {
        "playListId": 1620220689111
    }
}

Example of Error JSON Response

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

Field Description

Field Type Description
code int Return code
status string Return status
message string Return message
data object Operation result
playListId string Playlist ID

Java Request Example:

    public void testCreatePlayList() throws Exception {
        String url = "https://api.polyv.net/v2/play-list/create";
        Map<String, String> params = new HashMap<>();
        params.put("userid", userid);
        params.put("title", "标题");
        params.put("description", "描述");
        params.put("tag", "标签");
        params.put("ptime", String.valueOf(System.currentTimeMillis()));
        params.put("sign", getSign(params, secretkey));
        String response = HttpClientUtil.getInstance().sendHttpPost(url, params);
        System.out.println(response);
    }
联系客服,在线咨询