Polyv Help Center

Help Center

Remove Video from Playlist

Updated: 2022-09-02 18:08:07

Interface Description

1、通过播放列表id和视频id将视频从播放列表移除
2、接口支持https协议

Interface URL

http://api.polyv.net/v2/play-list/remove-video

Online API Call

Request Method

POST

Interface Constraints

  1. The interface supports both HTTP and HTTPS. HTTPS is recommended to ensure interface security. Interface calls are subject to 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, valid within 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 never 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
vid true String Video ID

Example

http://api.polyv.net/v2/play-list/remove-video

Form Parameters:

vid=1b448be3239c2ef0cb3ab9fd105f7fb2_1&sign=316893CB4ED5E1ABDDA1883E2FEB4423DAF612C4&userid=1b448be323&ptime=1621217938573&playListId=1616396785347

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, it provides auxiliary error reason description.

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 code project. The test cases include HttpUtil.java and VodSignUtil.java in the downloaded 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 testRemoveVideoToPlaylist() throws Exception, NoSuchAlgorithmException {
    //公共参数,填写自己的实际参数
    String secretKey = super.secretKey;
    String userId = super.userId;
    String ptime = String.valueOf(System.currentTimeMillis());
    //业务参数
    String url = "http://api.polyv.net/v2/play-list/remove-video";
    String playListId  = "1616396785347";
    String vid = "1b448be3239c2ef0cb3ab9fd105f7fb2_1";

    Map<String, String> requestMap = new HashMap<>();
    requestMap.put("userid", userId);
    requestMap.put("ptime", ptime);
    requestMap.put("playListId", playListId);
    requestMap.put("vid", vid);
    requestMap.put("sign", VodSignUtil.getSign(requestMap, secretKey));

    String response = HttpUtil.postFormBody(url, requestMap);
    log.debug("测试将视频从播放列表移除,{}", response);
    //do somethings

}

Response Example

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

Success Example

{
    "code": 200,
    "status": "success",
    "message": "success"
}

Error Example

Incorrect Signature

{
    "code": 400,
    "status": "error",
    "message": "the sign is not right",
    "data": ""
}

Timestamp Expired

{
    "code": 400,
    "status": "error",
    "message": "ptime is too old.",
    "data": ""
}
联系客服,在线咨询