Delete Recorded Video in Live Staging
API Description
1、删除频道视频库中直播暂存的录制视频
2、接口URL中的{channelId}为频道号
3、接口支持https协议
API URL
http://api.polyv.net/live/v2/channel/recordFile/{channelId}/delete-record
Request Method
POST
API Constraints
The API supports both HTTP and HTTPS. HTTPS is recommended to ensure API security. API calls are subject to rate limits. See details
The request parameters
sessionIdandstartTimecannot both be empty. Only one parameter must be submitted.
Request Parameter Description
| Parameter | Required | Type | Description |
|---|---|---|---|
| appId | true | String | Account appId See details on obtaining keys |
| timestamp | true | Long | Current 13-digit millisecond timestamp, valid for 3 minutes |
| sign | true | String | Signature, a 32-character uppercase MD5 value. The appSecret key used to generate the signature is critical for communication data security. It must not be saved or used directly on the client side. All APIs must be called through the customer's own server to relay requests to the POLYV server for response data. See signature generation rules |
| sessionId | false | String | Session ID of the recorded video |
| startTime | false | String | Start time of the recorded video, format: yyyyMMddHHmmss, e.g., 20210317181043 [Can be obtained via Query Channel Recorded Video Info] |
Example
http://api.polyv.net/live/v2/channel/recordFile/2139283/delete-record
Form parameters:
appId=frlr1zazn3&sign=BDB4FA97143100ADFEBCE7E52106C1DE&sessionId=fweo0zn28w&channelId=2139283×tamp=1621841153611
Response Parameter Description
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Response status code, 200 for success, non-200 for failure See global error description |
| status | String | Response status text |
| message | String | Response description, auxiliary error reason when code is 400 or 500 |
| data | String | Returns an empty string on success or failure |
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 project. The test cases include HttpUtil.java and LiveSignUtil.java in the downloaded file.
It is strongly recommended to use the Live Java SDK for API integration. The Live Java SDK provides unified encapsulation and optimization for API call logic, exception handling, data signing, and HTTP request thread pooling.
private static final Logger log = LoggerFactory.getLogger(ChannelPlayBackTest.class);
/**
* 删除直播暂存中的录制视频
* @throws IOException
* @throws NoSuchAlgorithmException
*/
@Test
public void testDeleteRecord() 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/v2/channel/recordFile/%s/delete-record";
String channelId = "2139283";
String sessionId = "fweo0zn28w";
String startTime = "20210311144834";
url= String.format(url, channelId);
Map<String, String> requestMap = new HashMap<>();
requestMap.put("appId", appId);
requestMap.put("timestamp", timestamp);
requestMap.put("channelId", channelId);
requestMap.put("sessionId", sessionId);
requestMap.put("sign", LiveSignUtil.getSign(requestMap, appSecret));
String response = HttpUtil.postFormBody(url, requestMap);
log.info("测试删除直播暂存中的录制视频,返回值:{}", response);
//do somethings
}
Response Example
For system global error descriptions, see Global Error Description
Success example
{
"code":200,
"status":"success",
"message":"",
"data":""
}
Error example
{
"code": 400,
"status": "error",
"message": "invalid signature.",
"data": ""
}
