删除文档
接口描述
1、删除课节文档接口
2、支持https协议
接口URL
http://api.polyv.net/hi-class-api/open/file/v1/delete
请求方式
POST
接口约束
1、接口同时支持HTTP 、HTTPS ,建议使用HTTPS 确保接口安全,接口调用有频率限制,详细请查看
请求参数描述
参数名
必选
类型
说明
timestamp
true
Long
当前13位毫秒级时间戳,3分钟内有效
sign
true
String
签名,为32位大写的MD5值,生成签名的appSecret密钥作为通信数据安全的关键信息,严禁保存在客户端直接使用,所有API都必须通过客户自己服务器中转调用POLYV服务器获取响应数据
【详见签名生成规则】
lessonId
true
Long
课节号
示例
http://api.polyv.net/hi-class-api/open/file/v1/delete
表单参数:
appId=z2gw5icesv&sign=935F4C0CF3EB84A3EFB2BC691DB714A5&lessonId=6707×tamp=1631780657591&fileId=42ba92e56017f4de261e692630447b662561988animate
响应参数描述
Java请求示例
快速接入基础代码请下载相关依赖源码, 点击下载源代码 ,下载后加入到自己的源码工程中即可。测试用例中的HttpUtil.java 和 LiveSignUtil.java 都包含在下载文件中。
强烈建议您使用直播Java SDK完成API的功能对接,直播Java SDK 对API调用逻辑、异常处理、数据签名、HTTP请求线程池进行了统一封装和优化。
/**
* 删除文档
* @throws IOException
* @throws NoSuchAlgorithmException
*/
@Test
public void testDeleteDocument() throws IOException, NoSuchAlgorithmException {
//公共参数,填写自己的实际参数
String appId = this.appId;
String appSecret = this.appSecret;
String timestamp = String.valueOf(System.currentTimeMillis());
//业务参数
String url = "http://api.polyv.net/hi-class-api/open/file/v1/delete";
String lessonId = "6956";
String fileId = "42ba92e56017f4de261e692630447b662561988animate";
//http 调用逻辑
Map<String, String> requestMap = new HashMap<>();
requestMap.put("appId", appId);
requestMap.put("timestamp", timestamp);
requestMap.put("lessonId", lessonId);
requestMap.put("fileId", fileId);
requestMap.put("sign", LiveSignUtil.getSign(requestMap, appSecret));
String response = HttpUtil.postFormBody(url, requestMap);
log.info("测试删除文档:{}", response);
}
响应示例
系统全局错误说明详见全局错误说明
成功示例
{
"code":200,
"status":"success",
"data":null,
"success":true
}
异常示例
{
"code": 400,
"status": "error",
"data": "",
"error": {
"code": xx,
"desc": "错误描述"
}
}
Last updated
Was this helpful?