Delete Courseware
Updated: 2025-01-14 16:02:26
Interface Description
1、通过视频id删除视频关联课件
2、接口URL中的{userid}为点播账号userid,具体参考菜单【使用须知】->【获取密钥】
3、接口支持https协议
Interface URL
http://api.polyv.net/v2/video/{userid}/deletePPT
Request Method
POST
Interface Constraints
- 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 |
|---|---|---|---|
| ptime | true | Long | Current time in milliseconds timestamp, valid within 3 minutes |
| sign | true | String | Signature, a 40-character uppercase SHA1 value. The secretkey used to generate the signature is critical for communication data security. It must not be saved or used directly on the client side. All APIs must be called through the customer's own server to relay requests to the POLYV server for response data. See signature generation rules |
| vid | true | String | Video ID, e.g., 1b448be323dec2a7bed6db61bd7d8a77_1 |
Example
http://api.polyv.net/v2/video/1b448be323/deletePPT
Form Parameters:
vid=1b448be323fb327a42539cbb788913b4_1&sign=9498A368F25A34DC77F2530A80B45E3946C5B892&ptime=1617676130323
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 |
| message | String | Response description, provides error details when code is 400 or 500 |
Error Code List
| Error Code | message | Description |
|---|---|---|
| 400 | sign can not be empty. | Signature string is empty |
| 400 | ptime is too old. | Timestamp has expired |
| 400 | ptime is illegal. | Timestamp parameter format is incorrect or exceeds current time by 3 minutes |
| 400 | Could not find user by userid. | User ID does not exist |
| 400 | the sign is not right. | Signature string is incorrect |
| 400 | 该视频尚未关联课件 | The video has no associated courseware |
Java Request Example
HttpUtil.java and VodSignUtil.java base code can be downloaded locally or obtained online from base code
private static final Logger log = LoggerFactory.getLogger(VodVideoCourseWare.class);
/**
* 删除课件
*/
@Test
public void testDeleteCourseWare() throws Exception, NoSuchAlgorithmException {
//公共参数,填写自己的实际参数
String secretKey = super.secretKey;
String userid = super.userId;
String ptime = String.valueOf(System.currentTimeMillis());
//业务参数
String url = String.format("https://api.polyv.net/v2/video/%s/deletePPT", userid);
String vid = "1b448be323fb327a42539cbb788913b4_1";
Map<String, String> requestMap = new HashMap<>();
requestMap.put("ptime", ptime);
requestMap.put("vid", vid);
requestMap.put("sign", VodSignUtil.getSign(requestMap, secretKey));
String response = HttpUtil.postFormBody(url, requestMap);
log.debug("测试删除课件,{}", response);
//do somethings
}
Response Example
For global system error descriptions, see Global Error Description
Success Example
{
"code": 200,
"status": "success",
"message": "success"
}
Error Example
{
"code": 400,
"status": "error",
"message": "ptime is too old.",
"data": ""
}
