Batch Delete Distribution Addresses
API Description
1、批量删除分发地址
2、接口支持https协议
API URL
http://api.polyv.net/live/v4/channel/distribute/delete-batch
Request Method
POST
API Constraints
The API supports both HTTP and HTTPS. HTTPS is recommended for security. API calls have frequency limits. See details
Distribution addresses cannot be deleted during active distribution streaming.
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. The appSecret key used to generate the signature is critical for communication data security. It must not be stored or used directly on the client. 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 |
| channelId | true | String | Channel ID |
| distributeIds | true | String | Distribution IDs, separated by commas |
Example
http://api.polyv.net/live/v4/channel/distribute/delete-batch?appId=frlr1zazn3&sign=43FE7344A53D59D573C240FB53DBE9C6&channelId=2272655×tamp=1639733294979
Form Parameters:
distributeIds=3160%2C3159
Response Parameter Description
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Response status code, 200 for success, non-200 for failure |
| status | String | Response result, determined by business logic: success returns "success", failure returns "error" |
| success | Boolean | Response result, determined by business logic: success returns true, failure returns false |
| data | Boolean | Returns true on success |
| error | Object | Error information when status code is non-200 See Error Field Description |
| requestId | String | Request ID, a unique UUID generated for each request. Only used for troubleshooting and debugging, not for business logic. |
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, download the relevant dependency source code. Click here to download the source code. After downloading, add it to your own project. The test cases include HttpUtil.java and LiveSignUtil.java, both contained in the download file.
It is strongly recommended to use the Live Java SDK for API integration. The Live 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(getClass());
/**
* 批量删除分发地址
* @throws IOException
*/
@Test
public void delete() throws IOException, NoSuchAlgorithmException {
//公共参数,填写自己的实际参数
String appId = super.appId;
String appSecret = super.appSecret;
String userId = super.userId;
String timestamp = String.valueOf(System.currentTimeMillis());
//业务参数
String url = "http://api.polyv.net/live/v4/channel/distribute/delete-batch";
String channelId = "2272655";
String distributeIds = "3160,3159";
//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);
Map<String, String> paramMap = new HashMap<>();
paramMap.put("distributeIds", distributeIds);
String response = HttpUtil.postFormBody(url, paramMap);
log.info("测试批量删除分发地址,返回值:{}", response);
//do somethings
}
Response Example
For global system error descriptions, see Global Error Description
Success Example
{
"code": 200,
"status": "success",
"requestId": "e2e23029f14a46098842dde4d8f097b4.1947.16397332982980199",
"data": true,
"success": true
}
Error Example
{
"code": 400,
"status": "error",
"error": {
"code": 10003,
"desc": "时间戳过期"
},
"success": false
}
