文章目录
接口URL
https://api.polyv.net/v2/group/account/get-info
接口说明
(接口调用有频率限制,详细请查看)
1、接口用于集团账号套餐情况
2、接口支持https
返回结果支持格式
JSON
请求方式
GET
请求数限制
TRUE
请求参数
参数名 | 必选 | 类型 | 说明 |
---|---|---|---|
appId | 是 | string | 从API设置中获取,在集团账号系统登记的appId |
timestamp | 是 | long | 当前13位毫秒级时间戳,3分钟内有效 |
sign | 是 | string | 签名,为32位大写的MD5值 |
响应成功JSON示例:
{
"code": 200,
"status": "success",
"message": "success",
"data": {
"liveInfo": {
"accountChannels": 2000,
"usedChannels": 5,
"totalChannels": 535,
"accountDurations": 2000000,
"usedDuration": 46,
"totalDepositedDuration": 225362,
"overDuration": 4,
"accountConcurences": 0,
"maxViewers": null
},
"vodInfo": {
"usedSpaces": 33.92,
"totalSpaces": 156.57,
"overSpaces": 0,
"accountSpace": 100,
"usedFlows": 502.92,
"totalFlows": 12045.82,
"overFlows": 0,
"accountFlow": 100
}
}
}
响应失败JSON示例:
未输入appId
{
"code": 400,
"status": "error",
"message": "appId is required.",
"data": ""
}
集团账号不存在
{
"code": 400,
"status": "error",
"message": "account not found.",
"data": ""
}
集团账号已被封禁
{
"code": 400,
"status": "error",
"message": "account is forbidden.",
"data": ""
}
时间戳错误
{
"code": 400,
"status": "error",
"message": "invalid timestamp.",
"data": ""
}
签名错误
{
"code": 403,
"status": "error",
"message": "invalid signature.",
"data": ""
}
字段说明
参数名 | 说明 |
---|---|
code | 响应代码,成功为200,失败为400,签名错误为401,异常错误500 |
status | 成功为success,失败为error |
message | 错误时为错误提示消息 |
data | 成功响应时为账号的套餐情况 |
liveInfo | 直播套餐信息 |
liveInfo.accountChannels | 集团账号总频道数 |
liveInfo.usedChannels | 已用频道数 |
liveInfo.totalChannels | 已分配频道数 |
liveInfo.accountDurations | 集团账号总分钟数 |
liveInfo.usedDuration | 已用分钟数 |
liveInfo.totalDepositedDuration | 已分配分钟数 |
liveInfo.overDuration | 超出分钟数 |
liveInfo.accountConcurences | 账号并发上限 |
liveInfo.maxViewers | 最高并发数 |
vodInfo | 点播套餐信息 |
vodInfo.usedSpaces | 已用空间 |
vodInfo.totalSpaces | 已分配空间 |
vodInfo.overSpaces | 超出空间 |
vodInfo.accountSpace | 总空间 |
vodInfo.usedFlows | 已用流量 |
vodInfo.totalFlows | 总分配流量 |
vodInfo.overFlows | 超出流量 |
vodInfo.accountFlow | 集团账号总流量 |
php请求示例
<?php
//引用config-group.php
include 'config-group.php';
$params = array(
'appId' => $appId,
'timestamp' => $timestamp
);
//生成sign
$sign = getSign($params); //详细查看config.php文件的getSign方法
$params['sign'] = $sign;
$url = "https://api.polyv.net/v2/group/account/get-info?".http_build_query($params);
$curl = curl_init();
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_TIMEOUT, 500);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_POST, 0);
$res = curl_exec($curl);
curl_close($curl);
echo $res;
?>