保利威文档中心

帮助中心

分配分账号空间接口-集团账号1.0

更新时间:2023-05-04 18:51:37

接口描述

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

接口URL

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

请求方式

POST

接口约束

1、接口同时支持HTTP 、HTTPS ,建议使用HTTPS 确保接口安全,接口调用有频率限制,详细请查看

请求参数描述

参数名 必选 类型 说明
appId true String 集团主账号appId【详见集团账号2.0获取密钥
timestamp true Long 当前13位毫秒级时间戳,3分钟内有效
sign true String 签名,为32位大写的MD5值,生成签名的appSecret密钥作为通信数据安全的关键信息,严禁保存在客户端直接使用,所有API都必须通过客户自己服务器中转调用POLYV服务器获取响应数据【详见签名生成规则
email true String 分帐号邮箱
type false String 添加-add,回收-recover。默认为add
space false Integer 空间数值,单位G
all false Integer 是否回收所有,1-为回收所有。仅type为recover有效

示例


响应参数描述

参数名 类型 说明
code Integer 响应状态码,200为成功返回,非200为失败【详见全局错误说明
status String 响应状态文本信息
message String 响应描述信息,当code为400或者500的时候,辅助描述错误原因

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

响应示例

成功示例

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

异常示例

{
    "code": 403,
    "status": "error",
    "message": "invalid signature.",
    "data": ""
}
联系客服,在线咨询