保利威文档中心

帮助中心

查询抽奖活动

更新时间:2025-02-07 17:07:12

接口描述

1、查询抽奖活动
2、接口支持https协议

接口URL

http://api.polyv.net/live/v4/channel/lottery-activity/get

请求方式

GET

接口约束

1、接口同时支持HTTP 、HTTPS ,建议使用HTTPS 确保接口安全,接口调用有频率限制,详细请查看 2、若参数不正确则会响应400异常

请求参数描述

参数名 必选 类型 说明
appId true String 账号appId【详见获取密钥
timestamp true Long 当前13位毫秒级时间戳,3分钟内有效
sign true String 签名,为32位大写的MD5值,生成签名的appSecret密钥作为通信数据安全的关键信息,严禁保存在客户端直接使用,所有API都必须通过客户自己服务器中转调用POLYV服务器获取响应数据【详见签名生成规则
channelId true Integer 频道号
id true Long 抽奖活动ID

示例

http://api.polyv.net/live//v4/channel/lottery-activity/get?appId=frlr1zazn3&timestamp=1665629374000&sign=6CFA3141718E1AF0155889EEA2988206&channelId=2974342&id=1

响应描述

参数名 类型 说明
code Integer 状态码,与 http 状态码相同,用于确定基本的响应状态
status String 响应结果,由业务决定,成功返回success,失败返回error
success Boolean 是否成功响应
requestId String 请求ID,每次请求生成的唯一的 UUID,仅可用于排查、调试,不应该和业务挂上钩
error Object 状态码非200时的错误信息【详见Error字段描述
data Object 响应详细信息【详见data字段说明

Error响应描述

参数名 类型 说明
code Integer 错误代码,用于确定具体的错误原因
desc String 错误描述,与 error.code 对应

data响应描述

参数名 类型 说明
id Long 抽奖活动ID
activityName String 抽奖活动名称
lotteryCondition String 抽奖类型
status String 抽奖活动状态
amount Integer 中奖人数
hiddenWinnerAmount String 是否隐藏中奖人数
lotteryRange String 参与抽奖用户类型: all:全部,customGroup:自定义分组
customGroup Array 自定义分组信息【详见CustomGroup
customGroupLotteryType String 分组抽取方式, average:等额抽奖, random:随机抽奖
customGroupLotteryAmount Integer 每组抽取数量
hiddenAttendeeNumber String 是否隐藏参与人数
repeatWinEnabled String 允许重复中奖
receiveEnabled String 是否填写收货信息
receiveInfo Array 收货字段信息列表,无条件抽奖时填写【详见ReceiveInfo
prizeName String 奖品名称
thumbnail String 奖品图片
activityDuration String 活动时长(分钟)
inviteType String 邀请方式
externalListLink String 外部名单链接
externalInviteNumLink String 获取邀请人数链接
inviteNum Integer 邀请人数
duration Integer 观看时长
comment String 评论内容
acceptType String 领奖方式,form:表单,link:外链,qrCode:识别二维码,
formInfo Array 领奖方式表单字段信息 【详见ReceiveInfo
prizeUrl String 领奖方式奖品链接
qrCode String 领奖方式二维码链接
qrCodeTips String 领奖方式二维码提示语
realPrice BigDecimal 优惠价格
price BigDecimal 奖品原价
prizeInfo Array 奖品信息 【详见PrizeInfo
questionGroupId Long 问答组模板ID
perAnswerDuration Integer 每道题的答题时长
lotteryOnlineEnabled String 开奖时观众需在线, 值:Y/N, 默认Y(无条件分组抽奖时设置生效)

CustomGroup响应描述

参数名 类型 说明
id Long 分组ID
title String 分组标题
type String 分组类型
count String 分组人数

ReceiveInfo响应描述

参数名 类型 说明
type String 类型, userName:姓名、userPhone:手机号、custom:自定义
field String 字段名
tips String 提示语
required Boolean 是否必填,true/false

PrizeInfo响应描述

参数名 类型 说明
prizeItem String 奖项名称
correctAnswerCount Integer 答对题目数
prizeName String 奖品名称
thumbnail String 奖品图片
realPrice BigDecimal 优惠价格
price BigDecimal 奖品原价
acceptType String 领奖方式,form:表单,link:外链,qrCode:识别二维码
formInfo Array 领奖方式表单字段信息 【详见ReceiveInfo
prizeUrl String 领奖方式奖品链接
qrCode String 领奖方式二维码链接
qrCodeTips String 领奖方式二维码提示语
amount Integer 中奖人数
hiddenWinnerAmount String 是否隐藏中奖人数

Java请求示例

快速接入基础代码请下载相关依赖源码点击下载源代码 ,下载后加入到自己的源码工程中即可。测试用例中的HttpUtil.java 和 LiveSignUtil.java 都包含在下载文件中。

强烈建议您使用直播Java SDK完成API的功能对接,直播Java SDK 对API调用逻辑、异常处理、数据签名、HTTP请求线程池进行了统一封装和优化。


响应示例

系统全局错误说明详见全局错误说明

成功示例

{
    "code": 200,
    "status": "success",
    "requestId": "723ed01861804e9aa3dc1cf1aced83d5.72.17097790901718347",
    "data": {
        "id": 20521,
        "activityName": "无条件抽奖",
        "lotteryCondition": "none",
        "amount": 1,
        "receiveEnabled": "Y",
        "receiveInfo": [
            {
                "type": "userName",
                "field": "姓名",
                "tips": "请输入您的名称",
                "required": true
            },
            {
                "type": "userPhone",
                "field": "手机",
                "tips": "请输入您的手机号码",
                "required": true
            }
        ],
        "prizeName": "键盘",
        "activityDuration": null,
        "inviteType": "poster",
        "inviteNum": null,
        "duration": null,
        "comment": null,
        "externalListLink": null,
        "externalInviteNumLink": null,
        "acceptType": null,
        "formInfo": null,
        "prizeUrl": null,
        "qrCode": null,
        "qrCodeTips": null,
        "thumbnail": null,
        "realPrice": null,
        "price": null,
        "status": null,
        "prizeInfo": null,
        "questionGroupId": null,
        "perAnswerDuration": null,
        "lotteryRange": "all",
        "repeatWinEnabled": "N",
        "customGroup": [],
        "hiddenWinnerAmount": "N",
        "hiddenAttendeeNumber": "N",
        "customGroupLotteryType": "random",
        "customGroupLotteryAmount": null
    },
    "success": true
}

异常示例

{
    "code": 400,
    "status": "error",
    "requestId": "d310b70bc329403f87f77f9203d50f89.128.16360831552223589",
    "error": {
        "code": 20001,
        "desc": "application not found."
    },
    "success": false
}
联系客服,在线咨询