保利威文档中心

幫助中心

直播答題-新增微信使用者的復活卡

更新時間:2022-05-23 19:00:06

介面URL

http://api.polyv.net/live/v2/qa/addrevive

介面說明

1、作用:取得頻道直播狀態
2、介面支援https協定

請求方式

GET

請求參數限制

true

請求參數

參數名 必選 類型 說明
appId string 非業務參數,從API設定中取得,在直播系統登記的appId
timestamp string 目前時間毫秒級時間戳(13位,三分鐘有效)
unionIds string 多個微信帳號unionId,用英文逗號隔開
num int 新增復活卡的數量
sign string 校驗簽名,32位大寫MD5值

回應成功JSON範例:

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

欄位說明

參數名 說明
status 回應狀態
data 回應結果
message 異常錯誤資訊

php請求範例

<?php
  $appId = "epxt70r96u";
  $timestamp = time()*1000;
  $unionIds = "test1,test2";
  $num = 1;
  $appSecret = "cb4a16edc2ef4f78941e00cd0b3bd867";
  $str = $appSecret."appId$appId"."num$num"."timestamp$timestamp"."unionIds$unionIds".$appSecret;
  $sign = strtoupper(md5($str));
  $url = "http://api.polyv.net/live/v2/qa/addrevive?";
  echo file_get_contents($url."appId=$appId"."&timestamp=$timestamp"."&unionIds=$unionIds"."&num=$num"."&sign=$sign");
?>

簽名規則:

​ 將請求參數按照參數名字典順序排列,連接參數名與參數值,並在首尾加上appSecret,產生32位大寫MD5值,作為sign。 以下是範例過程:  ​ 1、請求參數為: ​ timestamp = "1494399085000" ​ appId = "egymbtsf38"

​ 2、將請求參數按照參數名字典順序排列 ​ appId = "egymbtsf38" ​ timestamp = "1494399085000"

​ 3、連接字串 連接參數名與參數值,並在首尾加上appSecret(此處appSecret的值為6ef8d34c08f44e91a18428842ff0ba7e),如下: ​ 6ef8d34c08f44e91a18428842ff0ba7eappIdegymbtsf38timestamp14943990850006ef8d34c08f44e91a18428842ff0ba7e

​ 4、產生32位大寫MD5值簽名sign ​ 9291DE270E8C79FD4B805CDD45B6BC2B

联系客服,在线咨询