http://api.polyv.net/live/v3/channel/donate/update-point-enabled
1、作用:修改积分打赏开关,不传channelId 修改全局积分打赏开关
2、全局积分打赏开关关闭时,如果开启频道的积分打赏,将会返回失败
3、接口支持https协议
{
code: 200,
status: "success",
message: "",
data: ""
}
{
code: 400,
status: "error",
message: "invalid timestamp.",
data: ""
}
<?php
//引用config.php
include 'config.php';
//接口需要的参数(非sign)赋值
$userId = "XXXXXXXX";
$channelId = "127075";
$donatePointEnabled = "N";
$params = array(
'appId'=>$appId,
'donatePointEnabled'=>$donatePointEnabled,
'channelId'=>$channelId,
'timestamp'=>$timestamp
);
//生成sign
$sign = getSign($params); //详细查看config.php文件的getSign方法
$url="http://api.polyv.net/live/v3/channel/donate/update-point-enabled?appId=$appId&channelId=$channelId&donatePointEnabled=$donatePointEnabled&sign=$sign×tamp=$timestamp";
$ch = curl_init() or die ( curl_error() );
curl_setopt( $ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, 360);
$response = curl_exec ( $ch );
curl_close ( $ch );
echo $response;
?>