Polyv Help Center

Help Center

Delete Document

Updated: 2024-10-21 09:33:43

Interface Description

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

Interface URL

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

Request Method

POST

Interface Constraints

  1. The interface supports both HTTP and HTTPS. HTTPS is recommended to ensure interface security. Interface calls have frequency limits. See details

Request Parameter Description

Parameter Required Type Description
appId true String Account appId [See Get Secret Key]
timestamp true Long Current 13-digit millisecond timestamp, valid within 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 stored or used directly on the client side. All APIs must be called through your own server to relay requests to the POLYV server for response data. [See Signature Generation Rules]
lessonId true Long Lesson ID
fileId true String File ID(s). If multiple, separate with English commas. This value originates from the response data.contents[0].fileId of the Query Uploaded Documents for a Lesson interface.

Example

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

Form Parameters:

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

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
error Error Error object [See Global Error Description]
data String Empty on success, empty on failure.

Java Request Example

For quick integration of the base code, please download the relevant dependency source code. Click here to download the source code. After downloading, add it to your own project source code. The HttpUtil.java and LiveSignUtil.java in the test cases are included 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 pools.

/**
 * 删除文档
 * @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);
    
}

Response Example

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

Success Example

{
    "code":200,
    "status":"success",
    "data":null,
    "success":true
}

Error Example

{
  "code": 400,
  "status": "error",
  "data": "",
  "error": {
    "code": xx,
    "desc": "错误描述"
  }
}
联系客服,在线咨询