Modify Playlist Information
Updated: 2022-09-02 18:08:07
API Description
1、通过播放列表ID修改播放列表信息
2、接口支持https协议
API URL
http://api.polyv.net/v2/play-list/update
Request Method
POST
API Constraints
- The API supports both HTTP and HTTPS. HTTPS is recommended to ensure interface security. API calls have frequency limits. See details
Request Parameter Description
| Parameter | Required | Type | Description |
|---|---|---|---|
| userid | true | String | POLYV VOD account ID. Refer to Get Secret Key for acquisition. Path: Official website -> Login -> VOD (API Interface) |
| ptime | true | Long | Current time in milliseconds timestamp, valid for 3 minutes |
| sign | true | String | Signature, a 40-character uppercase SHA1 value. The secretkey used to generate the signature is critical for communication data security. It must not be stored or used directly on the client side. All APIs must be relayed through the customer's own server to call the POLYV server for response data. See Signature Generation Rules |
| playListId | true | String | Playlist ID |
| title | true | String | Title |
| description | false | String | Description |
| tag | false | String | Tag |
Example
http://api.polyv.net/v2/play-list/update
Form Parameters:
sign=609227D5F17FA3EED7A250691F68D0334614C554&description=%E6%B5%8B%E8%AF%95%E4%BF%AE%E6%94%B9%E6%8F%8F%E8%BF%B0&tag=%E4%BF%AE%E6%94%B9%E6%A0%87%E7%AD%BE&title=%E6%B5%8B%E8%AF%95%E4%BF%AE%E6%94%B9%E5%88%97%E8%A1%A8%E4%BF%A1%E6%81%AF5-6&userid=1b448be323&ptime=1620284179218&playListId=1620281719396
Response Parameter Description
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Response status code. 200 indicates success, non-200 indicates failure. See Global Error Description |
| status | String | Response status text |
| message | String | Response description. When code is 400 or 500, provides auxiliary error reason |
| data | Object | Returns the modified playlist ID on success, empty on failure. See data field description |
data Field Description
| Parameter | Type | Description |
|---|---|---|
| playListId | Long | Playlist ID |
Java Request Example
For quick integration of basic code, please download the relevant dependency source code. Click to download source code. After downloading, add it to your own source project. HttpUtil.java and VodSignUtil.java in the test case are included in the download file.
It is strongly recommended to use the VOD Java SDK for API functionality integration. The VOD 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(VodPlaylistTest.class);
/**
* 修改播放列表信息
* @throws Exception
* @throws NoSuchAlgorithmException
*/
@Test
public void testModifyPlaylist() throws Exception, NoSuchAlgorithmException {
//公共参数,填写自己的实际参数
String secretKey = super.secretKey;
String userId = super.userId;
String ptime = String.valueOf(System.currentTimeMillis());
//业务参数
String url = "https://api.polyv.net/v2/play-list/update";
String playListId = "1620281719396";
String title = "测试修改列表信息5-6";
String tag = "修改标签";
String description = "测试修改描述";
Map<String, String> requestMap = new HashMap<>();
requestMap.put("userid", userId);
requestMap.put("ptime", ptime);
requestMap.put("playListId", playListId);
requestMap.put("title", title);
requestMap.put("description", description);
requestMap.put("tag", tag);
requestMap.put("sign", VodSignUtil.getSign(requestMap, secretKey));
String response = HttpUtil.postFormBody(url, requestMap);
log.debug("测试修改播放列表信息,{}", response);
//do somethings
}
Response Example
For system global error descriptions, see Global Error Description
Success Example
{
"code": 200,
"status": "success",
"message": "success",
"data": {
"playListId": 1620281719396
}
}
Error Example
{
"code":400,
"status":"error",
"message":"the sign is not right",
"data":""
}
