Delete a Single Whitelist Entry
Updated: 2022-10-12 15:25:43
API Description
1、删除单个白名单
2、(channelId, timestamp, appId)参与sign签名,并和sign一起通过url传递,请求体参数不参与签名,通过post请求体传递【请设置请求头contentType:application/json】
3、接口支持https协议
API URL
https://api.polyv.net/meet/v1/channel/auth-whitelist/delete
Request Method
POST
API Constraints
- The API has a frequency limit. Click here for 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] |
| channelId | true | Integer | Channel ID |
Request Body Parameter Description
| Parameter | Required | Type | Description |
|---|---|---|---|
| code | true | String | The whitelist entry to delete, maximum length 64 characters |
Example
https://api.polyv.net/meet/v1/channel/auth-whitelist/delete?appId=fyirmfdak4×tamp=1657786379352&sign=CEA301164F9BA5076F156C1EB60F22F8&channelId=3220878
Request Body Parameters
{
"code": "111"
}
Response Parameter Description
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Status code, same as HTTP status code, used to determine the basic response status |
| status | String | Response result, determined by the business. Returns "success" on success, "error" on failure |
| success | Boolean | Whether the response was successful |
| requestId | String | Request ID, a unique UUID generated for each request. Only used for troubleshooting and debugging, should not be tied to business logic |
| error | Object | Error information when the status code is not 200 [See Error Field Description] |
| data | String | Returns "true" on success, empty on error |
Error Parameter Description
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Error code, used to identify the specific error cause |
| desc | String | Error description, corresponding to error.code |
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 source code project. The test cases include HttpUtil.java and LiveSignUtil.java in the downloaded file.
It is strongly recommended to use the Live Java SDK for API integration. The Live Java SDK provides unified packaging and optimization for API call logic, exception handling, data signing, and HTTP request thread pooling.
private static final Logger log = LoggerFactory.getLogger(WhitelistDelete.class);
/**
* 删除单个白名单
* @throws IOException
*/
@Test
public void testWhitelistDelete() throws IOException, NoSuchAlgorithmException {
//公共参数,填写自己的实际参数
String appId=super.appId;
String appSecret=super.appSecret;
String userId = super.userId;
String timestamp=String.valueOf(System.currentTimeMillis());
//业务参数
String url = "https://api.polyv.net/meet/v1/channel/auth-whitelist/delete";
String channelId = "2191532";
String body = "{\n" +
" \"code\": \"111\"\n" +
"}";
//http 调用逻辑
Map<String,String> requestMap = new HashMap<>();
requestMap.put("appId", appId);
requestMap.put("timestamp",timestamp);
requestMap.put("channelId",channelId);
requestMap.put("sign",LiveSignUtil.getSign(requestMap, appSecret));
url = HttpUtil.appendUrl(url, requestMap);
String response = HttpUtil.postJsonBody(url, body, null);
log.info("测试删除单个白名单接口返回值:{}",response);
//do somethings
}
Response Example
For a description of global system errors, see Global Error Description
Success Example
{
"code": 200,
"status": "success",
"message": "",
"data": true
}
Error Example
{
"code": 400,
"status": "error",
"error": {
"code": 10003,
"desc": "时间戳过期"
},
"success": false
}
{
"code": 403,
"status": "error",
"error": {
"code": 10002,
"desc": "签名错误"
},
"success": false
}
{
"code": 400,
"status": "error",
"requestId": "20e774c2414447fe9d44801ff92a7d39.69.16655431425530263",
"error": {
"code": 30005,
"desc": "非法频道ID: 3344784"
},
"success": false
}
{
"code": 400,
"status": "error",
"requestId": "8640ff25366e4776a9b3ebf84bf8e302.61.16655432357454531",
"error": {
"code": 10001,
"desc": "会员码不能为空"
},
"data": null,
"success": false
}
