保利威帮助中心

保利威API和SDK文档

保利威
    空中课堂
  • 产品与服务
    视频直播

    云直播

    适用活动/营销/会议直播场景

    云课堂

    适用教育培训直播场景

    直播私有云

    直播本地私有化部署
    视频点播

    云点播

    视频在线存储/加密/云播放

    点播私有云

    点播本地私有化部署
    直播硬件

    直播舱

    移动式教学直播间
    增值服务

    现场服务

    活动直播现场拍摄执行服务

    运营服务

    保姆式直播运营保障服务

    盗版下架

    帮助下架第三方平台盗版视频

    直播推广

    同步宣发至200+媒体/视频平台
  • 解决方案
    行业解决方案
    金融行业
    银行| 保险| 证券
    在线教育
    医疗行业
    政务行业
    场景解决方案
    企业培训
    空中课堂
    营销直播
    展会直播
    空中宣讲会
    大会直播
    微信直播
    年会直播
    税务直播
    通用解决方案
    视频微门户
    无延迟直播
    HTML5技术
    短视频
    互动小班课
    小程序直播
    视频加密
    防录屏技术
    直播品牌定制
    直播硬件
  • 案例
    在线教育
    在线教育|培训机构|教务机构|中小学
    医疗健康
    传统医院|基层医疗机构|在线医疗
    家电地产
    电器|卫浴|家纺|地产
    政企机构
    政务|传统企业|媒体
    金融行业
    银行|保险|证券|互联网金融
    汽车行业
    汽车|汽车评测|驾校
    互联网
    招聘网|资讯网|旅行网
    其他行业
    零售行业|奢侈品|资格认证
    客户说
  • 下载与帮助

    帮助中心

    下载中心
    云直播 云点播
    新手入门
    云直播 云点播
    开发者中心
    云直播 云点播
    功能大全
    云直播 云点播
    视频教程
    保利威学院
    在线客服
    咨询电话
    400-158-8816
    服务邮箱
    service@polyv.net
  • 直播干货
  • 关于保利威
    关于我们
    为什么选择保利威?
    公司介绍
    加入我们
    联系我们
    企业新闻
    服务体系
    5G直播前沿
    渠道合作
    直播拍摄合作
    全国统一客服热线
    400-158-8816
    服务邮箱
    service@polyv.net
    市场合作
    bd@polyv.net
    简历投递
    hr@polyv.net
登录
免费试用
你的位置:首页 / 集团账号

集团账号:分配分账号空间接口

2020年7月14日由严俤仔发表

接口URL

https://api.polyv.net/v2/group/vod/set-space

接口说明

(接口调用有频率限制,详细请查看)

1、集团账号给分账号分配或回收空间接口
2、接口支持https

返回结果支持格式

JSON

请求方式

POST

请求数限制

TRUE

请求参数

参数名 必选 类型 说明
appId 是 string 从API设置中获取,在集团账号系统登记的appId
timestamp 是 long 当前13位毫秒级时间戳,3分钟内有效
sign 是 string 签名,为32位大写的MD5值
email 是 string 分帐号邮箱
type 否 string 添加-add,回收-recover。默认为add
space 否 int 空间数值,单位G
all 否 int 是否回收所有,1-为回收所有。仅type为recover有效

响应成功JSON示例:

{
    "code":200,
    "status":"success",
    "message":"success"
}

响应失败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 错误时为错误提示消息

php请求示例

<?php
//引用config.php
include 'config-group.php';

$params = array(
  'appId' => $appId,
  'timestamp' => $timestamp,
  'email' => 'email@polyv.net',
  'type' => 'recover',
  'all' => '1'
);

//生成sign
$sign = getSign($params); //详细查看config.php文件的getSign方法
$params['sign'] = $sign;

$url = "https://api.polyv.net/v2/group/vod/set-space?".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;
?>

签名规则(config.php文件代码查看)

http://dev.polyv.net/2018/liveproduct/l-api/rule/sign/

以上内容是否对您有帮助?根本没有帮助文档较差文档一般文档不错文档很好
Loading...

分类:集团账号

集团账号:获取分账号的加密信息

2020年7月9日由黄裕丰发表

接口URL

https://api.polyv.net/v2/group/account/get-user-sign

接口说明

(接口调用有频率限制,详细请查看)

1、接口用于获取集团账号下子用户的API调用加密信息
2、接口支持https

返回结果支持格式

JSON

请求方式

GET

请求数限制

TRUE

请求参数

参数名 必选 类型 说明
appId 是 string 从API设置中获取,在集团账号系统登记的appId
timestamp 是 long 当前13位毫秒级时间戳,3分钟内有效
sign 是 string 签名,为32位大写的MD5值
email 是 string 集团子用户邮箱账号

响应成功JSON示例:

{
    "code": 200,
    "status": "success",
    "message": "success",
    "data": "CNQq8T+gp27RLr4jfIqJFxsNgpe3+h4wQ0z7bs1RhLkK8oasUk2bNuQKuZKQLxHEh8vwptHZKzK53uge8n9ah00ZX9hsQ5g8a8QltR5AKWgXvle39lP8JFDtHtKLBYFpuhpknoE5xMfPd26/UJIsIioPzKpWm0GVAFiikm3/c2fCkEbKPlfuIaEHb/Uoyx8WP6I2jEnCB96eCI0ayOyR1WtAjwy4hEd8C+sYFzK73sd3Uyj8PCivq0x6akKqiYqNfkXyzA+U+uRXjI9oS6fXMkd44RJLfKwyt+VoXO80XG/CcZf3X4bgFlTosiM3bTqWuV1fSJByuW1r009eeUaEROl6lx0tGflthHV3sPwNjaU="
}

响应失败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": 400,
    "status": "error",
    "message": "暂无权限",
    "data": ""
}

字段说明

参数名 说明
code 响应代码,成功为200,失败为400,签名错误为401,异常错误500
status 成功为success,失败为error
message 错误时为错误提示消息
data 成功时,为新创建的账号的加密信息。
留意,该字段值经过AES加密,需解密后才能得到明文信息,解密方法请参考下方的说明。
解密后json串参数 说明
userId 用户ID
liveAppId 直播appID
liveAppSecret 直播app加密串
vodSecretKey 点播加密key
vodBakSecretKey 点播备用加密key
writetoken 点播写token
readtoken 点播读token

java请求示例

private void testUserSign() {
        String url = "http://api.polyv.net/v2/group/account/get-user-sign";
        // appId和加密串
        String appId = "xxxxxxx";
        String appSecret = "xxxxxxxxxxxxxxxxxx";
        String email = "123@polyv.net";

        Map<String, String> params = new HashMap<>();
        params.put("email", email);
        // 调用Polyv的工具类方法设置sign
        PolyvTool.setLiveSign(params, appId, appSecret);
        String content = HttpClientUtil.getInstance()
                .sendHttpGet(url + "?" + PolyvTool.mapJoinNotEncode(params));
        System.out.println(content);
    }

加解密算法说明

加密说明

使用AES加密算法,相关参数说明如下
key:集团主账号AppSecret前16位字符串, AppSecret可在后台的个人账号信息查到
iv:集团主账号AppSecret后16位字符串
加密模式:CBC
填充:pkcs5padding
数据块:128位
加密结果编码:base64
字符集:utf8

Java解密示例


import org.apache.tomcat.util.codec.binary.Base64; import javax.crypto.Cipher; import javax.crypto.SecretKey; import javax.crypto.spec.IvParameterSpec; import javax.crypto.spec.SecretKeySpec; import java.nio.charset.StandardCharsets; import java.security.GeneralSecurityException; public class Demo { /** * 使用AES算法解密无编码的原始字节数组,返回无编码的字节数组结果。 * * @param input 原始字节数组 * @param key 符合AES要求的秘钥 * @param iv 符合AES要求的初始向量 * @return 解密后的字节数组 */ public static byte[] decrypt(byte[] input, byte[] key, byte[] iv) { try { SecretKey secretKey = new SecretKeySpec(key, "AES"); IvParameterSpec ivParam = new IvParameterSpec(iv); Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding"); cipher.init(Cipher.DECRYPT_MODE, secretKey, ivParam); return cipher.doFinal(input); } catch (GeneralSecurityException e) { throw new IllegalStateException("Security exception", e); } } public static void main(String[] args) { // 以下数据均为模拟数据,请以实际为准 // 请求接口返回的数据 String data = "XEiWa02vG2Qg8MdjcwdHvQ=="; // 集团主账号的AppSecret, 共32个字符,将其截成两部分,每部分16个字符 String groupAppSecret = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; byte[] keyBytes = groupAppSecret.substring(0, 16).getBytes(StandardCharsets.UTF_8); byte[] ivBytes = groupAppSecret.substring(16).getBytes(StandardCharsets.UTF_8); // 解密,先Base64解码,然后使用上面截取的两部分字符串作为key和iv进行解密 byte[] decryptBytes = decrypt(Base64.decodeBase64(data.getBytes(StandardCharsets.UTF_8)), keyBytes, ivBytes); // 解密结果 String decrypt = new String(decryptBytes, StandardCharsets.UTF_8); System.out.println(decrypt); } }

签名规则及工具文件代码

https://dev.polyv.net/2020/liveproduct/l-api/rule/live-api-java-detail/

以上内容是否对您有帮助?根本没有帮助文档较差文档一般文档不错文档很好
Loading...

分类:集团账号

集团账号:分配直播并发数接口

2019年12月2日由严俤仔发表

接口URL

https://api.polyv.net/v2/group/live/set-concurrences

接口说明

(接口调用有频率限制,详细请查看)

1、接口用于分配直播的并发数
2、接口支持https

返回结果支持格式

JSON

请求方式

POST

请求数限制

TRUE

请求参数

参数名 必选 类型 说明
appId 是 string 从API设置中获取,在集团账号系统登记的appId
timestamp 是 long 当前13位毫秒级时间戳,3分钟内有效
sign 是 string 签名,为32位大写的MD5值
email 是 string 分配给的账号邮箱地址
type 否 string 分配的类型,add:新增,recover:回收 默认为add新增
concurrences 是 int 分配的并发数,大于0的整数

响应成功JSON示例:

{
  "code": 200, 
  "status": "success", 
  "message": "success", 
  "data": "success"
}

响应失败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": "已超过账号可使用上限",
    "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 success

php请求示例

<?php
//引用config-group.php
include 'config-group.php';

$params = array(
  'appId' => $appId,
  'email' => $email,
  'type' => $type,
  'durations' => $durations,
  'timestamp' => $timestamp
);

//生成sign
$sign = getSign($params); //详细查看config.php文件的getSign方法
$params['sign'] = $sign;

$url = "https://api.polyv.net/v2/group/live/set-concurrences?".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;
?>

签名规则(config.php文件代码查看)

http://dev.polyv.net/2018/liveproduct/l-api/rule/sign/

以上内容是否对您有帮助?根本没有帮助文档较差文档一般文档不错文档很好
Loading...

分类:集团账号

集团账号:分配分账号流量接口

2019年12月2日由严俤仔发表

接口URL

https://api.polyv.net/v2/group/vod/set-flow

接口说明

(接口调用有频率限制,详细请查看)

1、集团账号给分账号分配或回收流量接口
2、接口支持https

返回结果支持格式

JSON

请求方式

POST

请求数限制

TRUE

请求参数

参数名 必选 类型 说明
appId 是 string 从API设置中获取,在集团账号系统登记的appId
timestamp 是 long 当前13位毫秒级时间戳,3分钟内有效
sign 是 string 签名,为32位大写的MD5值
email 是 string 分帐号邮箱
type 否 string 添加-add,回收-recover。默认为add
flow 否 int 流量数值,单位G
all 否 int 是否回收所有,1-为回收所有。仅type为recover有效

响应成功JSON示例:

{
    "code":200,
    "status":"success",
    "message":"success"
}

响应失败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 错误时为错误提示消息

php请求示例

<?php
//引用config.php
include 'config-group.php';

$params = array(
  'appId' => $appId,
  'timestamp' => $timestamp,
  'email' => 'email@polyv.net',
  'type' => 'recover',
  'all' => '1'
);

//生成sign
$sign = getSign($params); //详细查看config.php文件的getSign方法
$params['sign'] = $sign;

$url = "https://api.polyv.net/v2/group/vod/set-flow?".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;
?>

签名规则(config.php文件代码查看)

http://dev.polyv.net/2018/liveproduct/l-api/rule/sign/

以上内容是否对您有帮助?根本没有帮助文档较差文档一般文档不错文档很好
Loading...

分类:集团账号

集团账号:创建分账号

2019年12月2日由严俤仔发表

接口URL

https://api.polyv.net/v2/group/account/add-user

接口说明

(接口调用有频率限制,详细请查看)

1、集团账号创建分账号接口
2、接口支持https

返回结果支持格式

JSON

请求方式

POST

请求数限制

TRUE

请求参数

参数名 必选 类型 说明
appId 是 string 从API设置中获取,在集团账号系统登记的appId
timestamp 是 long 当前13位毫秒级时间戳,3分钟内有效
sign 是 string 签名,为32位大写的MD5值
email 是 string 分帐号邮箱
password 是 string 分帐号密码
name 是 string 联系人姓名
mobile 是 string 手机号
url 是 string 机构网址
type 是 string 套餐类型,live-直播,vod-点播
note 否 string 分账号备注信息
duration 否 int 直播可用分钟数
channels 否 int 直播频道数
concurrences 否 int 直播并发数
flow 否 int 点播流量大小,单位G
space 否 int 点播空间大小,单位G

响应成功JSON示例:

{
    "code":200,
    "status":"success",
    "message":"success"
    "data": "XEiWa02vG2Qg8MdjcwdHvQ=="
}

响应失败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 成功时,为新创建的账号信息。
留意,该字段值经过加密,需解密后才能得到明文信息。解密方法详见下面的说明。
解密后json串参数 说明
userId 用户ID
liveAppId 直播appID
liveAppSecret 直播app加密串
vodSecretKey 点播加密key
vodBakSecretKey 点播备用加密key
writetoken 点播写token
readtoken 点播读token

加解密算法说明

加密说明

使用AES加密算法,相关参数说明如下
key:集团主账号AppSecret前16位字符串, AppSecret可在后台的个人账号信息查到
iv:集团主账号AppSecret后16位字符串
加密模式:CBC
填充:pkcs5padding
数据块:128位
加密结果编码:base64
字符集:utf8

Java解密示例


import org.apache.tomcat.util.codec.binary.Base64; import javax.crypto.Cipher; import javax.crypto.SecretKey; import javax.crypto.spec.IvParameterSpec; import javax.crypto.spec.SecretKeySpec; import java.nio.charset.StandardCharsets; import java.security.GeneralSecurityException; public class Demo { /** * 使用AES算法解密无编码的原始字节数组,返回无编码的字节数组结果。 * * @param input 原始字节数组 * @param key 符合AES要求的秘钥 * @param iv 符合AES要求的初始向量 * @return 解密后的字节数组 */ public static byte[] decrypt(byte[] input, byte[] key, byte[] iv) { try { SecretKey secretKey = new SecretKeySpec(key, "AES"); IvParameterSpec ivParam = new IvParameterSpec(iv); Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding"); cipher.init(Cipher.DECRYPT_MODE, secretKey, ivParam); return cipher.doFinal(input); } catch (GeneralSecurityException e) { throw new IllegalStateException("Security exception", e); } } public static void main(String[] args) { // 以下数据均为模拟数据,请以实际为准 // 请求接口返回的数据 String data = "XEiWa02vG2Qg8MdjcwdHvQ=="; // 集团主账号的AppSecret, 共32个字符,将其截成两部分,每部分16个字符 String groupAppSecret = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; byte[] keyBytes = groupAppSecret.substring(0, 16).getBytes(StandardCharsets.UTF_8); byte[] ivBytes = groupAppSecret.substring(16).getBytes(StandardCharsets.UTF_8); // 解密,先Base64解码,然后使用上面截取的两部分字符串作为key和iv进行解密 byte[] decryptBytes = decrypt(Base64.decodeBase64(data.getBytes(StandardCharsets.UTF_8)), keyBytes, ivBytes); // 解密结果 String decrypt = new String(decryptBytes, StandardCharsets.UTF_8); System.out.println(decrypt); } }

接口请求示例

Java请求示例

private void testAddUser() {
        String url = "http://api.polyv.net/v2/group/account/add-user";
        // appId和加密串
        String appId = "xxxxxxx";
        String appSecret = "xxxxxxxxxxxxxxxxxx";
        Map<String, String> params = new HashMap<>();
        params.put("email", "email@polyv.net");
        params.put("name", "测试");
        params.put("mobile", "123");
        params.put("password", "123");
        params.put("type", "live");
        // 调用Polyv的工具类方法设置sign
        PolyvTool.setLiveSign(params, appId, appSecret);
        String content = HttpClientUtil.getInstance().sendHttpPost(url, params);
        System.out.println(content);
}

php请求示例

<?php
//引用config.php
include 'config-group.php';

$params = array(
  'appId' => $appId,
  'timestamp' => $timestamp,
  'email' => 'email@polyv.net',
  'name' => '测试',
  'mobile' => 'input your mobile',
  'password' => 'password',
  'type' => 'live'
);

//生成sign
$sign = getSign($params); //详细查看config.php文件的getSign方法
$params['sign'] = $sign;

$url = "https://api.polyv.net/v2/group/account/add-user?".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;
?>

签名规则及工具文件代码

Java版
https://dev.polyv.net/2020/liveproduct/l-api/rule/live-api-java-detail/

php版
http://dev.polyv.net/2018/liveproduct/l-api/rule/sign/

以上内容是否对您有帮助?根本没有帮助文档较差文档一般文档不错文档很好
Loading...

分类:集团账号

集团账号:查询分账号的分配记录

2019年11月29日由严俤仔发表

接口URL

https://api.polyv.net/v2/group/account/list-allocate-log

接口说明

(接口调用有频率限制,详细请查看)

1、查询集团账号给分账号的分配记录
2、接口支持https

返回结果支持格式

JSON

请求方式

GET

请求数限制

TRUE

请求参数

参数名 必选 类型 说明
appId 是 string 从API设置中获取,在集团账号系统登记的appId
timestamp 是 long 当前13位毫秒级时间戳,3分钟内有效
sign 是 string 签名,为32位大写的MD5值
emails 是 string 分帐号邮箱,多个以英文逗号分隔
type 否 string 查询的分配记录类型,all包括点播和直播, live-直播, vod-点播
startTime 否 string 查询记录的开始时间,格式为yyyy-MM-dd HH:mm:ss
endTime 否 string 查询记录的结束时间,格式为yyyy-MM-dd HH:mm:ss
page 否 int 请求的页面
pageSize 否 int 页面大小

响应成功JSON示例:

{
  "code": 200, 
  "status": "success", 
  "message": "success", 
  "data": {
    "pageNumber": 1, 
    "totalPages": 11, 
    "pageSize": 1, 
    "contents": [
      {
        "email": "testdata@polyv.com", 
        "date": "2019-11-18 18:21:38", 
        "origin": "ADD_CONCURRENCES", 
        "originText": "添加并发数", 
        "space": null, 
        "flow": null, 
        "channels": null, 
        "concurrences": 970, 
        "duration": null
      }
    ], 
    "totalItems": 11
  }
}

响应失败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 成功响应时分配记录的分页对象
contents 分配记录列表
email 分帐号邮箱
date 分配记录时间
origin 来源
originText 来源描述
space 增加的点播空间,单位字节
flow 增加的点播流量,单位字节
channels 频道分配值
concurrences 并发分配值
duration 分钟数分配值

php请求示例

<?php
//引用config-group.php
include 'config-group.php';

$params = array(
  'appId' => $appId,
  'timestamp' => $timestamp,
  'sign' => $sign,
  'emails' => 'testdata@polyv.com'
);

//生成sign
$sign = getSign($params); //详细查看config.php文件的getSign方法
$params['sign'] = $sign;

$url = "https://api.polyv.net/v2/group/account/list-allocate-log?".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;
?>

签名规则(config.php文件代码查看)

http://dev.polyv.net/2018/liveproduct/l-api/rule/sign/

以上内容是否对您有帮助?根本没有帮助文档较差文档一般文档不错文档很好
Loading...

分类:集团账号

集团账号:分配直播分钟数接口

2019年11月21日由严俤仔发表

接口URL

https://api.polyv.net/v2/group/live/set-durations

接口说明

(接口调用有频率限制,详细请查看)

1、接口用于分配直播的分钟数
2、接口支持https

返回结果支持格式

JSON

请求方式

POST

请求数限制

TRUE

请求参数

参数名 必选 类型 说明
appId 是 string 从API设置中获取,在集团账号系统登记的appId
timestamp 是 long 当前13位毫秒级时间戳,3分钟内有效
sign 是 string 签名,为32位大写的MD5值
email 是 string 分配给的账号邮箱地址
type 否 string 分配的类型,add:新增,recover:回收 默认为add新增
duration 是 int 分配的分钟数,大于0的整数

响应成功JSON示例:

{
  "code": 200, 
  "status": "success", 
  "message": "success", 
  "data": "success"
}

响应失败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": "已超过账号可使用上限",
    "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 success

php请求示例

<?php
//引用config-group.php
include 'config-group.php';

$params = array(
  'appId' => $appId,
  'email' => $email,
  'type' => $type,
  'durations' => $durations,
  'timestamp' => $timestamp
);

//生成sign
$sign = getSign($params); //详细查看config.php文件的getSign方法
$params['sign'] = $sign;

$url = "https://api.polyv.net/v2/group/live/set-durations?".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;
?>

签名规则(config.php文件代码查看)

http://dev.polyv.net/2018/liveproduct/l-api/rule/sign/

以上内容是否对您有帮助?根本没有帮助文档较差文档一般文档不错文档很好
Loading...

分类:集团账号

集团账号:分配直播的频道数接口

2019年11月21日由严俤仔发表

接口URL

https://api.polyv.net/v2/group/live/set-channels

接口说明

(接口调用有频率限制,详细请查看)

1、接口用于分配直播的频道数
2、接口支持https

返回结果支持格式

JSON

请求方式

POST

请求数限制

TRUE

请求参数

参数名 必选 类型 说明
appId 是 string 从API设置中获取,在集团账号系统登记的appId
timestamp 是 long 当前13位毫秒级时间戳,3分钟内有效
sign 是 string 签名,为32位大写的MD5值
email 是 string 分配给的账号邮箱地址
type 否 string 分配的类型,add:新增,recover:回收 默认为add新增
channels 是 int 分配的频道数量,大于0的整数

响应成功JSON示例:

{
  "code": 200, 
  "status": "success", 
  "message": "success", 
  "data": "success"
}

响应失败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

php请求示例

<?php
//引用config-group.php
include 'config-group.php';

$params = array(
  'appId' => $appId,
  'email' => $email,
  'type' => $type,
  'channels' => $channels,
  'timestamp' => $timestamp
);

//生成sign
$sign = getSign($params); //详细查看config.php文件的getSign方法
$params['sign'] = $sign;

$url = "https://api.polyv.net/v2/group/live/set-channels?".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;
?>

签名规则(config.php文件代码查看)

http://dev.polyv.net/2018/liveproduct/l-api/rule/sign/

以上内容是否对您有帮助?根本没有帮助文档较差文档一般文档不错文档很好
Loading...

分类:集团账号

集团账号:查询账号套餐情况

2019年11月8日由严俤仔发表

接口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;
?>

签名规则(config.php文件代码查看)

http://dev.polyv.net/2018/liveproduct/l-api/rule/sign/

以上内容是否对您有帮助?根本没有帮助文档较差文档一般文档不错文档很好
Loading...

分类:集团账号

集团账号

    • 集团账号:分配直播分钟数接口
    • 集团账号:查询分账号的分配记录
    • 集团账号:查询账号套餐情况
    • 集团账号:分配直播的频道数接口
    • 集团账号:分配分账号流量接口
    • 集团账号:创建分账号
    • 集团账号:分配直播并发数接口
    • 集团账号:获取分账号的加密信息
    • 集团账号:分配分账号空间接口

Copyright © 2021保利威

咨询电话:400-158-8816 | 服务邮箱:service@polyv.net |市场合作:bd@polyv.net

© 2013-2021 广州易方信息科技股份有限公司 版权所有    粤ICP备12077762号    法律顾问:广东汇知通律师事务所     粤公网安备44011302001506号