Set Featured Live List
Updated: 2023-04-14 14:20:03
API Description
1、给部分账号提供设置重点直播列表,仅开通功能的账号可以使用
2、接口支持https协议
API URL
http://api.polyv.net/live/v4/channel/ccb/focus/reset
Request Method
POST
API Constraints
- The API supports both HTTP and HTTPS. HTTPS is recommended for security. API calls are subject to rate limits. See details
Request Parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
| appId | true | String | Account appId See details on obtaining credentials |
| 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 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 |
| channelIds | false | String | Comma-separated list of channel IDs for featured live streams. This will overwrite the existing featured channel IDs. Leave empty to clear the featured live list. |
Example
http://api.polyv.net/live/v4/channel/ccb/focus/reset?appId=ff0outsa15&sign=A6FF5B958C2D5103FB4A93334091ED93&channelIds=2731380%2C2750506%2C2737621%2C365032×tamp=1642648261357
Response Parameters
| 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. Used only for troubleshooting and debugging, should not be tied to business logic |
| data | String | Returns null |
| error | Object | Error information See Error parameter description |
Error Parameter Description
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Error code, used to determine the specific error cause |
| desc | String | Error description, corresponds 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 project. The test cases include HttpUtil.java and LiveSignUtil.java, both contained in the downloaded file.
@Test
public void testCCBFocusChannel() throws IOException, NoSuchAlgorithmException {
//公共参数,填写自己的实际参数
String appId = super.appId;
String appSecret = super.appSecret;
String timestamp = String.valueOf(System.currentTimeMillis());
//业务参数
String channelId = "2731380,2750506,2737621,365032";
String url = "http://api.polyv.net/live/v4/channel/ccb/focus/reset";
//http 调用逻辑
Map<String,String> requestMap = new HashMap<>();
requestMap.put("appId", appId);
requestMap.put("timestamp",timestamp);
requestMap.put("channelIds", channelId);
requestMap.put("sign", LiveSignUtil.getSign(requestMap, appSecret));
url = MapUtil.appendUrl(url,requestMap);
String response = HttpUtil.postFormBody(url, null);
log.info("测试清空频道聊天记录接口返回值:{}",response);
}
Response Example
For global system error descriptions, see Global Error Description
Success Example
{
"code": 200,
"status": "success",
"requestId": "70fdf8c9808a4a799ffbdc3073630e3f.83.16426482643007221",
"data": null,
"success": true
}
Error Example
{
"code": 400,
"status": "error",
"requestId": "4081dbac03e6441e8bdd301d8feee5a2.124.16360831818611581",
"error": {
"code": 20001,
"desc": "application not found."
},
"success": false
}
