保利威文档中心

幫助中心

分配直播並發數介面-集團帳號1.0

更新時間:2023-05-04 18:46:13

介面描述

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

介面URL

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

請求方式

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新增
concurrences false Integer 分配的並發數,大於0的整數

範例


回應參數描述

參數名 類型 說明
code Integer 回應狀態碼,200為成功返回,非200為失敗【詳見全域錯誤說明
status String 回應狀態文字資訊
message String 回應描述資訊,當code為400或500時,輔助描述錯誤原因
data String 請求成功返回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;
?>

回應範例

成功範例

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

異常範例

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