查询子账号统计详情
接口描述
1、按日期查询子账号统计详情列表
2、接口userid为点播账号userid,具体参考菜单【使用须知】->【获取密钥】
3、接口支持https协议
接口URL
https://api.polyv.net/v2/sub-account/stats/detail/list
请求方式
POST
接口约束
1、接口同时支持HTTP 、HTTPS ,建议使用HTTPS 确保接口安全,接口调用有频率限制,详细请查看
2、email、appId 必传其中一个,如果同时传了email和appId,则优先使用email
请求参数描述
ptime
true
Long
当前时间的毫秒级时间戳,3分钟内有效
startDate
true
String
开始日期,格式为:yyyy-MM-dd,例如:2021-04-07,时间跨度不能超过一年
endDate
true
String
结束日期,格式为:yyyy-MM-dd,例如:2021-04-10,时间跨度不能超过一年
false
String
要查询的子账号邮箱,如果同时传了email和appId,则优先使用email
appId
false
String
要查询的子账号appId
示例
https://api.polyv.net/v2/sub-account/stats/detail/list
表单参数:
sign=25B8ED6CD0AF4E0058D44DA5D395A569701328F9&ptime=1623056999195&userid=cca90d24f7&startDate=2021-05-01&endDate=2021-06-01
响应参数描述
details字段说明
currentDay
String
日期,格式:yyyy-MM-dd,如:2021-06-01
pcFlowSize
Long
PC端播放流量,单位:byte
mobileFlowSize
Long
移动端播放流量,单位:byte
totalFlowSize
Long
总流量,单位:byte
pcView
Long
PC端播放量,单位:个
mobileView
Long
移动端播放量,单位:个
totalView
Long
总播放量,单位:个
pcDuration
Long
PC端播放时长,单位:秒
mobileDuration
Long
移动端播放时长,单位:秒
totalDuration
Long
总播放时长,单位:秒
Java请求示例
快速接入基础代码请下载相关依赖源码, 点击下载源代码 ,下载后加入到自己的源码工程中即可。测试用例中的HttpUtil.java 和 VodSignUtil.java 都包含在下载文件中。
强烈建议您使用点播Java SDK完成API的功能对接,点播Java SDK 对API调用逻辑、异常处理、数据签名、HTTP请求线程池进行了统一封装和优化。能大大提高B端的接入速度和便捷性;
/**
* 子账号详情数据列表
* @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
}
响应示例
系统全局错误说明详见全局错误说明
成功示例
{
"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
}
]
}
}
异常示例
{
"code":400,
"status":"error",
"message":"sign can not be empty.",
"data":""
}
Last updated
Was this helpful?