Get Live Concurrent Summary Data for Multiple Cloud Users API
Updated: 2022-09-02 18:08:07
API URL
https://api.polyv.net/live/internal/v3/user/concurrent/yunduo/summary
API Description
1、获取多用户的直播并发汇总数据接口
2、接口支持https
Supported Format
JSON
Request Method
GET、POST
Request Limit
TRUE
Request Parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
| appId | Yes | string | Obtained from API settings, the appId registered in the live streaming system |
| timestamp | Yes | long | Current millisecond-level timestamp (13 digits) |
| sign | Yes | 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 to obtain response data. See signature generation rules |
| users | Yes | string | Live streaming user IDs, multiple users separated by "," |
| start | Yes | string | Start date of the query time range, format: yyyy-MM-dd |
| end | Yes | string | End date of the query time range, format: yyyy-MM-dd |
Successful Response JSON Example:
{
"code": 200,
"status": "success",
"message": "",
"data": {
[{"statAt":1629166440000,"peakCCV":"2888","pullType":"cdn"}]
}
}
Response Field Description
| Parameter | Description |
|---|---|
| code | Status code: 200 for success, 403 for signature error, 400 for parameter error, 500 for server error |
| status | "success" for success, "error" for error |
| message | Empty string for success, error description for error |
| data | Response data |
| data.startAt | Timestamp of the peak concurrent moment (13 digits) |
| data.peakCCV | Peak concurrent user count |
| data.pullType | Statistical dimension |
Failed Response JSON Example:
Parameter error
{
"code": 400,
"status": "error",
"message": "param validate error",
"data": ""
}
Missing appId
{
"code": 400,
"status": "error",
"message": "appId is required.",
"data": ""
}
Incorrect appId
{
"code": 400,
"status": "error",
"message": "application not found.",
"data": ""
}
Timestamp error
{
"code": 400,
"status": "error",
"message": "invalid timestamp.",
"data": ""
}
Signature error
{
"code": 403,
"status": "error",
"message": "invalid signature.",
"data": ""
}
Invalid channel ID
{
"code": 403,
"status": "error",
"message": "illegal channel id: %s",
"data": ""
}
Java Request Example
public void testAddRecordTask() {
String url = "https://api.polyv.net/live/internal/v3/user/concurrent/yunduo/summary";
// 加密串找管理人员要
String appSecret = "xxxxxxxxxxxxxxxxxx";
Map<String, String> params = new HashMap<>();
params.put("users", "xxxxx,yyyyy");
params.put("start", "2021-08-01");
params.put("end", "2021-08-31");
// 调用Polyv的工具类方法设置sign
PolyvTool.setLiveSign(params, "", appSecret);
String content = HttpClientUtil.getInstance()
.sendHttpPost(url, params);
System.out.println(content);
}
