Allocate Sub-Account Space Interface - Group Account 1.0
Updated: 2023-05-04 18:51:37
Interface Description
1、集团账号给分账号分配或回收空间接口
2、接口支持https协议
Interface URL
http://api.polyv.net/v2/group/vod/set-space
Request Method
POST
Interface Constraints
- The interface supports both HTTP and HTTPS. HTTPS is recommended to ensure interface security. Interface calls have frequency limits. See details
Request Parameter Description
| Parameter | Required | Type | Description |
|---|---|---|---|
| appId | true | String | Group master account appId See Group Account 2.0 Get Secret Key |
| timestamp | true | Long | Current 13-digit millisecond timestamp, valid for 3 minutes |
| sign | true | String | Signature, a 32-character uppercase MD5 value. The appSecret key used to generate the signature is critical information for communication data security. It must not be saved or used directly on the client side. All APIs must be relayed through the customer's own server to the POLYV server for response data. See Signature Generation Rules |
| true | String | Sub-account email | |
| type | false | String | Add - add, Recover - recover. Default is add |
| space | false | Integer | Space value, unit G |
| all | false | Integer | Whether to recover all, 1 - recover all. Only valid when type is recover |
Example
Response Parameter Description
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Response status code, 200 for success, non-200 for failure See Global Error Description |
| status | String | Response status text information |
| message | String | Response description message, assists in describing the error reason when code is 400 or 500 |
PHP Request Example
<?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;
?>
Response Example
Success Example
{
"code":200,
"status":"success",
"message":"success"
}
Error Example
{
"code": 403,
"status": "error",
"message": "invalid signature.",
"data": ""
}
