Copy https://api.polyv.net/live/v3/chat/inConductInteractive
Copy 查询某个频道是否正在进行交互动作(签到、问卷、抽奖、正在答题等)
Copy {
"code" : 200 ,
"status" : "success" ,
"message" : "" ,
"data" : {
"sign" : true ,
"lottery" : false ,
"questionnaire" : false ,
"testQuestions" : false
}
}
Copy //时间搓过期
{
"code" : 400 ,
"status" : "error" ,
"message" : "ptime is too old." ,
"data" : ""
}
//签名错误
{
"code" : 403 ,
"status" : "error" ,
"message" : "invalid signature." ,
"data" : ""
}
Copy <? 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;
?>