1、删除课节
2、(timestamp, appId)参与sign签名,并和sign一起通过url传递,请求体参数不参与签名,通过post请求体传递【请设置请求头contentType:application/json】
3、接口支持https协议
http://api.polyv.net/hi-class-api/open/lesson/v1/delete
http://api.polyv.net/hi-class-api/open/lesson/v1/delete?appId=frlr1zazn3&sign=179E93416D4144C920428C0325436FF2×tamp=1634629905501
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);
}
{
"code": 200,
"status": "success",
"requestId": "5bc5c3a4a88a487192cb0256b1dadb7f.97.16346299090189905",
"data": {
"status": false
},
"success": true
}
{
"code": 400,
"status": "error",
"data": "",
"error": {
"code": xx,
"desc": "错误描述"
}
}