Query Channel for Ongoing Interaction
Updated: 2022-09-02 18:08:07
Interface URL
https://api.polyv.net/live/v3/chat/inConductInteractive
Interface Description
Query whether a specific channel is currently conducting interactive actions (check-in, questionnaire, lottery, ongoing quiz, etc.)
JSON
Request Method
GET
Request Parameters
Return Result
{
"code": 200,
"status": "success",
"message": "",
"data": {
"sign": true,
"lottery": false,
"questionnaire": false,
"testQuestions": false
}
}
Failure Return JSON (without JSONP)
//时间搓过期
{
"code": 400,
"status": "error",
"message": "ptime is too old.",
"data": ""
}
//签名错误
{
"code": 403,
"status": "error",
"message": "invalid signature.",
"data": ""
}
Field Description
PHP Request Example
<?php
//引用config.php
include 'config.php';
$params = array(
'appId' => $appId,
'timestamp' => $timestamp,
'channelId' => 195770
);
//生成sign
$sign = getSign($params); //详细查看config.php文件的getSign方法
$params['sign'] = $sign;
$url = "https://api.polyv.net/live/v3/chat/inConductInteractive?".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;
?>