Polyv Help Center

Help Center

Query Channel Mic Usage

Updated: 2022-09-02 18:08:07

API Description

1、分页获取频道连麦使用详情,默认查询账号下的所有频道
2、支持账号、批量频道获取连麦情况使用详情
3、接口支持https协议

API URL

http://api.polyv.net/live/v3/channel/statistics/mic/list

Online API Call

Request Method

GET

API Constraints

  1. The API supports both HTTP and HTTPS. HTTPS is recommended for security. API calls have frequency limits. See details

Request Parameter Description

Parameter Required Type Description
appId true String Account appId See details
timestamp true Long Current 13-digit millisecond timestamp, valid within 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 never be stored on the client side. All APIs must be called through your own server to relay requests to the POLYV server for response data. See signature generation rules
page false Integer Current page number, default 1
size false Integer Number of items per page, default 10, maximum 1000
channelIds false String Channel IDs, separated by commas, e.g., 100000,100001. Default queries all channels
startDay false String Start date, format: yyyy-MM-dd
endDay false String End date, format: yyyy-MM-dd

Example

http://api.polyv.net/live/v3/channel/statistics/mic/list?size=1000&startDay=2020-1-1&appId=frlr1zazn3&endDay=2021-2-11&sign=EE4F5413AEEF3CE5557CD2B44338AD8C&page=1&channelIds=1965681%2C1958888&timestamp=1621844590076

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
data Object Mic usage information on success See Data parameter description, empty on failure
Data Parameter Description
Parameter Type Description
pageSize Integer Number of items per page, default 10, maximum 1000
pageNumber Integer Current page number
totalItems Integer Total number of items
contents Array Query result list See Contents parameter description
startRow Integer Position of the first record on the current page in the total result set
firstPage Boolean Whether it is the first page, value: true/false
lastPage Boolean Whether it is the last page, value: true/false
prePageNumber Integer Previous page number
nextPageNumber Integer Next page number
limit Integer Number of items per page
totalPages Integer Total number of pages
endRow Integer Position of the last record on the current page in the total result set
offset Integer Pagination starting record
Contents Parameter Description
Parameter Type Description
userId String Account userId
channelId String Channel ID
currentDay String Usage date, format: yyyy-MM-dd
history Integer Mic usage minutes, unit: minutes

Java Request Example

For quick integration of basic code, please download the relevant dependency source code. Click to download source code. After downloading, add it to your own source 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(ChannelViewDataTest.class);
/**
 *  测试查询频道连麦详情数据
 * @throws IOException
 */
@Test
public void testMicDetailList() 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/v3/channel/statistics/mic/list";
    String size = "1000";
    String page = "1";
    String startDay = "2020-1-1";
    String endDay = "2021-2-11";
    String channelIds = "1965681,1958888";

    //http 调用逻辑
    Map<String,String> requestMap = new HashMap<>();
    requestMap.put("appId", appId);
    requestMap.put("timestamp",timestamp);
    requestMap.put("size",size);
    requestMap.put("page",page);
    requestMap.put("startDay",startDay);
    requestMap.put("endDay", endDay);
    requestMap.put("channelIds", channelIds);
    requestMap.put("sign",LiveSignUtil.getSign(requestMap, appSecret));
    String response = HttpUtil.get(url, requestMap);
    log.info("测试查询频道连麦详情数据,返回值:{}",response);
    //do somethings

}

Response Example

For global system error descriptions, see Global Error Description

Success Example

{
    "code":200,
    "status":"success",
    "message":"",
    "data":{
        "pageSize":1000,
        "pageNumber":1,
        "totalItems":3,
        "contents":[
            {
                "userId":"1b448be323",
                "channelId":1965681,
                "currentDay":"2020-12-03",
                "history":2
            },
            {
                "userId":"1b448be323",
                "channelId":1965681,
                "currentDay":"2020-10-28",
                "history":0
            },
            {
                "userId":"1b448be323",
                "channelId":1965681,
                "currentDay":"2020-10-21",
                "history":1
            }
        ],
        "startRow":1,
        "firstPage":true,
        "lastPage":true,
        "prePageNumber":1,
        "totalPages":1,
        "limit":3,
        "nextPageNumber":1,
        "endRow":3,
        "offset":0
    }
}

Error Example

{
    "code": 400,
    "status": "error",
    "message": "invalid signature.",
    "data": ""
}
联系客服,在线咨询