Delete Danmaku
Updated: 2025-01-14 15:59:53
API Description
1、通过弹幕id批量删除弹幕信息
2、接口URL中的{userid}为点播账号userid,具体参考菜单【使用须知】->【获取密钥】
3、接口支持https协议
API URL
http://api.polyv.net/v2/danmu/{userid}/delete
Request Method
POST
API Constraints
- The API supports both HTTP and HTTPS. HTTPS is recommended to ensure API security. API calls are subject to rate 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 used directly on the client side. All APIs must be called through the customer's own server to relay requests to the POLYV server to obtain response data. See signature generation rules |
| danmuIds | true | String | Danmaku IDs, separated by commas if multiple. Parameters obtained from Query Danmaku |
Example
http://api.polyv.net/v2/danmu/1b448be323/delete
Form parameters:
danmuIds=17251132&sign=E7149C694CEEC06D12E421B595A1D14A07D26A67&ptime=1617244337042
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, assists in describing error reasons when code is 400 or 500 |
| data | String | Returns "success" on success, empty on failure |
Error Code List
| Error Code | message | Description |
|---|---|---|
| 400 | sign can not be empty. | Encryption string is empty |
| 400 | ptime is too old. | Timestamp 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. | Incorrect encryption string |
| 500 | query failed. | Backend program threw an exception |
Java Request Example
For quick integration of basic code, download the relevant dependency source code. Click here to download the source code. After downloading, add it to your own source code project. HttpUtil.java and VodSignUtil.java in the test case are included in the download file.
It is strongly recommended to use the VOD Java SDK for API functionality integration. The VOD Java SDK provides unified encapsulation and optimization for API call logic, exception handling, data signing, and HTTP request thread pools.
private static final Logger log = LoggerFactory.getLogger(VodVideoManagementTest.class);
/**
* 删除弹幕
*/
@Test
public void testDeleteDanmu() throws Exception, NoSuchAlgorithmException {
//公共参数,填写自己的实际参数
String secretKey = super.secretKey;
String userId = super.userId;
String ptime = String.valueOf(System.currentTimeMillis());
//业务参数
String url = "http://api.polyv.net/v2/danmu/" + userId + "/delete";
String danmuIds = "17251132";
Map<String, String> requestMap = new HashMap<>();
requestMap.put("ptime", ptime);
requestMap.put("danmuIds", danmuIds);
requestMap.put("sign", VodSignUtil.getSign(requestMap, secretKey));
String response = HttpUtil.postFormBody(url, requestMap);
log.debug("测试删除弹幕,{}", response);
//do somethings
}
Response Example
For system-wide global error descriptions, see Global Error Description
Success Example
{
"code": 200,
"status": "success",
"message": "success",
"data": "success"
}
Error Example
{
"code": 400,
"status": "error",
"message": "ptime is too old.",
"data": ""
}
