Polyv Help Center

Help Center

Approve Chat Moderation Content

Updated: 2022-09-02 18:08:07

Interface URL

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

Interface Description

1. Purpose: Used to approve chat moderation content via the interface
2. The interface supports the HTTPS protocol

Supported Format

JSON

Request Method

POST

Request Limit

TRUE

Request Parameters

Parameter Required Type Description
appId Yes string Obtained from API settings, the appId registered in the live streaming system
timestamp Yes string Current time in seconds (13-digit timestamp)
sign Yes string Signature, a 32-character uppercase MD5 value. The appSecret key used to generate the signature is critical for communication data security. It must not be stored or used directly on the client side. All API calls must be relayed through the customer's own server to the POLYV server to obtain response data. See Signature Generation Rules
channelId Yes int Channel ID
passType Yes string Approval type: "all" for approving all, "time" for approving by time period, "id" for approving by chat moderation content ID
id No string Chat moderation content ID (required when passType is "id")
time No long 13-digit timestamp (required when passType is "time"). All chat moderation content messages before the given timestamp will be approved

Example of Successful Response

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

Example of Failed Response

Signature Error

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

Response Field Description

Name Type Description
code string Response code: 200 for success, 400 for failure, 403 for signature error, 500 for exception error
status string "success" for success, "error" for failure
message string Error prompt message when an error occurs
data string Success return information

PHP Request Example

<?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;
?>
联系客服,在线咨询