Polyv Help Center

Help Center

Delete Lesson

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

API Description

1、删除课节
2、(timestamp, appId)参与sign签名,并和sign一起通过url传递,请求体参数不参与签名,通过post请求体传递【请设置请求头contentType:application/json】
3、接口支持https协议

API URL

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

Request Method

POST

API Constraints

  1. The API supports both HTTP and HTTPS. HTTPS is recommended for security. API calls have a frequency limit. 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 for 3 minutes
sign true String Signature, a 32-character uppercase MD5 value See Signature Generation Rules

Request Body Parameter Description

Parameter Required Type Description
lessonId true Long Lesson ID

Example

http://api.polyv.net/hi-class-api/open/lesson/v1/delete?appId=frlr1zazn3&sign=179E93416D4144C920428C0325436FF2&timestamp=1634629905501

Request Body Parameters

{
    "lessonId": "8970"
}

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
error Error Error object See Global Error Description
data Object Empty on failure, deletion status on success See data field description

data Field Description

Parameter Type Description
status Boolean true: success; false: failure

Java Request Example

For quick integration of the base code, please download the related dependency source code. Click to download source code. After downloading, add it to your own source code project. HttpUtil.java and LiveSignUtil.java in the test cases are included in the downloaded file.

private static final Logger log = LoggerFactory.getLogger(VClassLessonTest.class);
/**
 * 删除课节
 * @throws IOException
 * @throws NoSuchAlgorithmException
 */
@Test
public void deleteLesson() throws IOException, NoSuchAlgorithmException {
    //公共参数,填写自己的实际参数
    String appId = super.appId;
    String appSecret = super.appSecret;
    String timestamp = String.valueOf(System.currentTimeMillis());
    
    //业务参数
    String url = "http://api.polyv.net/hi-class-api/open/lesson/v1/delete";
    String lessonId = "8970";
    
    //http 调用逻辑
    Map<String, String> requestMap = new HashMap<>();
    requestMap.put("appId", appId);
    requestMap.put("timestamp", timestamp);
    requestMap.put("sign", LiveSignUtil.getSign(requestMap, appSecret));
    
    Map<String, Object> jsonMap = new HashMap<>();
    jsonMap.put("lessonId", lessonId);
    
    url = HttpUtil.appendUrl(url, requestMap);
    String response = HttpUtil.postJsonBody(url, JSON.toJSONString(jsonMap), null);
    log.info("测试删除课节成功:{}", response);
}

Response Example

For system global error descriptions, see Global Error Description

Success Example

{
    "code": 200,
    "status": "success",
    "requestId": "5bc5c3a4a88a487192cb0256b1dadb7f.97.16346299090189905",
    "data": {
        "status": false
    },
    "success": true
}

Error Example

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