获取账号积分打赏设置

接口URL

http://api.polyv.net/live/v3/channel/donate/get-point-setting

接口说明

1、获取账号通用设置的积分打赏设置,如果提交channelId,接口同时返回频道的积分打赏开关设置
2、频道的积分打赏开关生效的前提为通用设置的积分打赏也同时为开
3、支持https

支持格式

JSON

请求方式

GET

请求参数

参数名必选类型说明

appId

string

账号应用下的appId

timestamp

string

当前时间的毫秒级时间戳(13位)

sign

String

签名,为32位大写的MD5值,生成签名的appSecret密钥作为通信数据安全的关键信息,严禁保存在客户端直接使用,所有API都必须通过客户自己服务器中转调用POLYV服务器获取响应数据【详见签名生成规则

channelId

int

是否需要查询频道的设置

操作成功响应示例

{
    "code": 200,
    "status": "success",
    "message": "",
    "data": {
        "userId": "edvf2fpec9",
        "donatePointEnabled": "N",
		"channelDonatePointEnabled": null,
        "queryPointUrl": null,
        "updatePointUrl": null,
        "requestFailTips": "积分异常,请稍后重试",
        "pointNotEnoughTips": "积分不足,无法打赏",
        "pointUnit": "点",
        "goods": [
            {
                "goodName": "鲜花",
                "goodImg": "//livestatic.videocc.net/uploaded/images/webapp/channel/donate/01-flower.png",
                "goodPrice": 0.00,
                "goodEnabled": "Y"
            },
            {
                "goodName": "咖啡",
                "goodImg": "//livestatic.videocc.net/uploaded/images/webapp/channel/donate/02-coffee.png",
                "goodPrice": 5.00,
                "goodEnabled": "Y"
            },
            {
                "goodName": "点赞",
                "goodImg": "//livestatic.videocc.net/uploaded/images/webapp/channel/donate/03-good.png",
                "goodPrice": 10.00,
                "goodEnabled": "Y"
            },
            {
                "goodName": "掌声",
                "goodImg": "//livestatic.videocc.net/uploaded/images/webapp/channel/donate/04-applaud.png",
                "goodPrice": 15.00,
                "goodEnabled": "Y"
            },
            {
                "goodName": "666",
                "goodImg": "//livestatic.videocc.net/uploaded/images/webapp/channel/donate/05-666.png",
                "goodPrice": 20.00,
                "goodEnabled": "Y"
            },
            {
                "goodName": "小星星",
                "goodImg": "//livestatic.videocc.net/uploaded/images/webapp/channel/donate/06-star.png",
                "goodPrice": 25.00,
                "goodEnabled": "Y"
            },
            {
                "goodName": "钻石",
                "goodImg": "//livestatic.videocc.net/uploaded/images/webapp/channel/donate/07-diamond.png",
                "goodPrice": 30.00,
                "goodEnabled": "Y"
            },
            {
                "goodName": "跑车",
                "goodImg": "//livestatic.videocc.net/uploaded/images/webapp/channel/donate/08-car.png",
                "goodPrice": 50.00,
                "goodEnabled": "Y"
            },
            {
                "goodName": "火箭",
                "goodImg": "//livestatic.videocc.net/uploaded/images/webapp/channel/donate/09-rocket.png",
                "goodPrice": 100.00,
                "goodEnabled": "Y"
            }
        ]
    }
}

操作失败响应示例

签名错误

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

响应字段说明

名称类型说明

code

string

响应代码,成功为200,失败为400,签名错误为403,异常错误500

status

string

成功为success,失败为error

message

string

错误时为错误提示消息

data

object

成功响应数据

donatePointEnabled

string

积分打赏设置开关,取值Y/N

channelDonatePointEnabled

string

频道的积分打赏设置开关,取值Y/N/null, 仅当donatePointEnabled=Y 和channelDonatePointEnabled = Y 时表示频道启用积分打赏设置

queryPointUrl

string

获取观众积分接口

updatePointUrl

string

更新观众积分接口

requestFailTips

string

接口请求失败错误提示

pointNotEnoughTips

string

打赏积分不足提示

pointUnit

string

积分的单位

goods

object[]

积分打赏道具列表

goods[].goodName

string

道具名称

goods[].goodImg

string

道具图片

goods[].goodPrice

float

道具价格

goods[].goodEnabled

string

道具的开关,取值Y/N

php请求示例

<?php
//引用config.php
include 'config.php';

$params = array(
	'appId' => $appId,
	'timestamp' => $timestamp
);

//生成sign
$sign = getSign($params); //详细查看config.php文件的getSign方法
$params['sign'] = $sign;

//接口请求url
$url = "`https://api.polyv.net/live/v3/channel/donate/get-point-setting?appId=".$appId."&sign=".$sign."&timestamp=".$timestamp;
//输出接口请求结果
echo file_get_contents($url);
?>

Last updated