Allocate Live Streaming Concurrency Interface - Group Account 1.0
Updated: 2023-05-04 18:46:13
Interface Description
1、接口用于分配直播的并发数
2、接口支持https协议
Interface URL
http://api.polyv.net/v2/group/live/set-concurrences
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 details in Group Account 2.0 Get Secret Key |
| timestamp | true | Long | Current 13-digit millisecond timestamp, valid within 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 and used directly on the client side. All APIs must be called through the customer's own server to relay requests to the POLYV server for response data. See details in Signature Generation Rules |
| true | String | Sub-account email | |
| type | false | String | Allocation type: add (add), recover (recover). Default is add |
| concurrences | false | Integer | Allocated concurrency number, an integer greater than 0 |
Example
Response Parameter Description
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Response status code, 200 for success, non-200 for failure See details in Global Error Description |
| status | String | Response status text information |
| message | String | Response description message, when code is 400 or 500, it provides auxiliary error reason description |
| data | String | Returns "success" on successful request, empty string on failure |
PHP Request Example
<?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;
?>
Response Example
Success Example
{
"code": 200,
"status": "success",
"message": "success",
"data": "success"
}
Error Example
{
"code": 403,
"status": "error",
"message": "invalid signature.",
"data": ""
}
