删除文档

接口描述

1、删除课节文档接口
2、支持https协议

接口URL

http://api.polyv.net/hi-class-api/open/file/v1/delete

请求方式

POST

接口约束

1、接口同时支持HTTP 、HTTPS ,建议使用HTTPS 确保接口安全,接口调用有频率限制,详细请查看

请求参数描述

参数名
必选
类型
说明

appId

true

String

timestamp

true

Long

当前13位毫秒级时间戳,3分钟内有效

sign

true

String

lessonId

true

Long

课节号

fileId

true

String

示例

http://api.polyv.net/hi-class-api/open/file/v1/delete

表单参数:

appId=z2gw5icesv&sign=935F4C0CF3EB84A3EFB2BC691DB714A5&lessonId=6707&timestamp=1631780657591&fileId=42ba92e56017f4de261e692630447b662561988animate

响应参数描述

参数名
类型
说明

code

Integer

status

String

响应状态文本信息

error

Error

data

String

请求成功时,返回值是空,请求失败时,返回值是空

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?