Modify Points Donation Toggle
Updated: 2022-09-02 18:08:07
Interface URL
http://api.polyv.net/live/v3/channel/donate/update-point-enabled
Interface Description
- Function: Modify the points donation toggle. If
channelIdis not provided, the global points donation toggle is modified. - When the global points donation toggle is disabled, enabling points donation for a specific channel will return a failure.
- The interface supports the HTTPS protocol.
Request Method
POST
Request Parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
| appId | Yes | string | Obtained from API settings, the appId registered in the live streaming system. |
| 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 never be used directly on the client side. All APIs must be called through the customer's own server to relay requests to the POLYV server for response data. For details, see Signature Generation Rules. |
| timestamp | Yes | string | Current 13-digit millisecond timestamp, valid within 3 minutes. |
| donatePointEnabled | Yes | string | Points donation toggle, value must be Y/N. |
| channelId | No | int | Channel ID. If this parameter is not provided, the global points donation toggle is modified. |
Successful Response JSON Example
{
code: 200,
status: "success",
message: "",
data: ""
}
Error Response JSON Example
{
code: 400,
status: "error",
message: "invalid timestamp.",
data: ""
}
Response Parameters
| Parameter | Description |
|---|---|
| status | Response status |
| data | Response result |
| code | HTTP response status code |
| message | Error message |
PHP Request Example
<?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;
?>
