Polyv Help Center

Help Center

Query Sub-Account Statistics Details

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

API Description

1、按日期查询子账号统计详情列表
2、接口userid为点播账号userid,具体参考菜单【使用须知】->【获取密钥】
3、接口支持https协议

API URL

https://api.polyv.net/v2/sub-account/stats/detail/list

Online API Call

Request Method

POST

API Constraints

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

  2. Either email or appId must be provided. If both are provided, email takes precedence.

Request Parameters

Parameter Required Type Description
userid true String POLYV VOD account ID. Refer to Get Secret Key for acquisition. Path: Official Website -> Login -> VOD (Development Settings)
ptime true Long Current time in milliseconds, valid for 3 minutes
sign true String Signature, a 40-character uppercase SHA1 value. See signature generation rules
startDate true String Start date, format: yyyy-MM-dd, e.g., 2021-04-07. Time span cannot exceed one year
endDate true String End date, format: yyyy-MM-dd, e.g., 2021-04-10. Time span cannot exceed one year
email false String Sub-account email to query. If both email and appId are provided, email takes precedence
appId false String Sub-account appId to query

Example

https://api.polyv.net/v2/sub-account/stats/detail/list

Form parameters:

sign=25B8ED6CD0AF4E0058D44DA5D395A569701328F9&ptime=1623056999195&userid=cca90d24f7&startDate=2021-05-01&endDate=2021-06-01

Response Parameters

Parameter Type Description
code Integer Response status code. 200 indicates success, non-200 indicates failure. See global error description
status String Response status text
message String Response description. When code is 400 or 500, provides error reason
data Object On success, returns a list of daily details for the sub-account. See data field description
Data Parameter Description
Parameter Type Description
details Array List of daily details for the sub-account. When there is no data for a day, related values are 0. See details field description

Details Field Description

Field Type Description
currentDay String Date, format: yyyy-MM-dd, e.g., 2021-06-01
pcFlowSize Long PC playback traffic, unit: byte
mobileFlowSize Long Mobile playback traffic, unit: byte
totalFlowSize Long Total traffic, unit: byte
pcView Long PC play count, unit: count
mobileView Long Mobile play count, unit: count
totalView Long Total play count, unit: count
pcDuration Long PC playback duration, unit: seconds
mobileDuration Long Mobile playback duration, unit: seconds
totalDuration Long Total playback duration, unit: seconds

Java Request Example

For quick integration of basic code, please download the relevant dependency source code. Click here to download source code. After downloading, add it to your own source project. The test case files HttpUtil.java and VodSignUtil.java are included in the download package.

It is strongly recommended to use the VOD Java SDK for API integration. The VOD Java SDK provides unified encapsulation and optimization for API call logic, exception handling, data signing, and HTTP request thread pools, greatly improving integration speed and convenience for B-end users.

/**
 * 子账号详情数据列表
 * @throws Exception
 */
@Test
public void testGetSubAccountDetailList() throws Exception {
    //公共参数,填写自己的实际参数
    String secretKey = super.secretKey;
    String userId = super.userId;
    String ptime = String.valueOf(System.currentTimeMillis());
    //业务参数
    String url = "https://api.polyv.net/v2/sub-account/stats/detail/list";
    String startDate="2021-05-01";
    String endDate="2021-06-01";
    String email="xxx@polyv.net";
    String appId="xxxxxxxx";

    Map<String, String> requestMap = new HashMap<>();
    requestMap.put("userId", userId);
    requestMap.put("ptime", ptime);
    requestMap.put("startDate", startDate);
    requestMap.put("endDate", endDate);
    requestMap.put("email", email);
    requestMap.put("appId", appId);
    requestMap.put("sign", VodSignUtil.getSign(requestMap, secretKey));

    String response = HttpUtil.postFormBody(url, requestMap);
    //do somethings

}

Response Example

For global system error descriptions, see Global Error Description

Success Example

{
    "code": 200,
    "status": "success",
    "message": "success",
    "data": {
        "details": [
            {
                "currentDay": "2021-06-01",
                "pcFlowSize": 0,
                "mobileFlowSize": 0,
                "totalFlowSize": 0,
                "pcView": 0,
                "mobileView": 0,
                "totalView": 0,
                "pcDuration": 0,
                "mobileDuration": 0,
                "totalDuration": 0
            }
        ]
    }
}

Error Example

{
    "code":400,
    "status":"error",
    "message":"sign can not be empty.",
    "data":""
}
联系客服,在线咨询