保利威文档中心

幫助中心

通過頻道聊天審核內容

更新時間:2022-09-02 18:08:07

介面URL

https://api.polyv.net/live/v3/channel/chat/pass-censor-content

介面說明

1、作用:用於通過聊天審核內容介面
2、介面支援https協定

支援格式

JSON

請求方式

POST

請求數限制

TRUE

請求參數

參數名 必選 類型 說明
appId string 從API設定中取得,在直播系統登記的appId
timestamp string 當前時間的秒級時間戳(13位)
sign String 簽名,為32位大寫的MD5值,生成簽名的appSecret金鑰作為通訊資料安全的關鍵資訊,嚴禁儲存在客戶端直接使用,所有API都必須透過客戶自己伺服器中轉呼叫POLYV伺服器取得回應資料【詳見簽名生成規則
channelId int 頻道號
passType string 通過類型,“all”: 全部通過, “time”:當前時間段通過, “id”:通過聊天審核內容ID通過
id string 聊天審核內容ID(當passType為“id”時必傳)
time long 13位時間戳(當passType為“time”時必傳),會通過所傳時間戳之前的所有聊天審核內容訊息

操作成功回應範例

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

操作失敗回應範例

簽名錯誤

{
    "code": 403,
    "status": "error",
    "message": "invalid signature.",
    "data": ""
}

回應欄位說明

名稱 類型 說明
code string 回應代碼,成功為200,失敗為400,簽名錯誤為403,異常錯誤500
status string 成功為success,失敗為error
message string 錯誤時為錯誤提示訊息
data string 成功返回資訊

php請求範例

<?php
//引用config.php
include 'config.php';

$params = array(
  'appId' => $appId,
  'timestamp' => $timestamp,
  'channelId' => '123456',
  'passType' => 'id',
  'id' => 'sdadada'
);

//生成sign
$sign = getSign($params); //详细查看config.php文件的getSign方法
$params['sign'] = $sign;

$url = "https://api.polyv.net/live/v3/channel/chat/pass-censor-content?".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, 1);
$res = curl_exec($curl);
curl_close($curl);

echo $res;
?>
联系客服,在线咨询