查询任务奖励活动分页列表
接口描述
1、查询任务奖励活动分页列表
2、接口支持https协议
接口URL
https://api.polyv.net/live/v4/channel/task-reward-activity/page
请求方式
GET
接口约束
1、接口同时支持HTTP 、HTTPS ,建议使用HTTPS 确保接口安全,接口调用有频率限制,详细请查看
请求参数描述
示例
https://api.polyv.net/live/v4/channel/task-reward-activity/page?channelId=4854808&pageSize=10&pageNumber=1&appId=frlr1zazn3&sign=012332FBD8DBCFC068AFCB484A2ADECB×tamp=1670550787318
响应体json:
{
"code": 200,
"status": "success",
"requestId": "aa9f6d7d-b67b-45de-b5d6-4e0302e4c609",
"data": {
"pageNumber": 1,
"pageSize": 10,
"totalPages": 1,
"totalItems": 1,
"contents": [
{
"activityId": 1519,
"userId": "cc167950af",
"channelId": 4990862,
"activityName": "123",
"activityMode": 1,
"taskRule": 2,
"status": 0,
"startTime": 1720611960000,
"endTime": 1720623600000,
"tasks": [
{
"taskId": 4827,
"sort": 1,
"startTime": 1720611960000,
"endTime": 1720623600000,
"reachCondition": {
"type": "sign",
"amount": 1
},
"rewardSetting": {
"type": "cash",
"amount": 30,
"limit": 1,
"customReward": ""
}
}
]
}
]
},
"success": true
}
响应参数描述
data参数描述
pageNumber
Integer
页码
pageSize
String
分页大小
totalPages
Boolean
总分页数量
totalItems
Object
总记录数
contents参数描述
channelId
true
Integer
频道id
activityId
true
Long
活动id
activityName
true
String
活动名称,最大长度64个字符
taskRule
false
Integer
任务规则:1:解锁任务,2:并行任务
startTime
false
Long
活动开始时间
endTime
false
Long
活动结束时间
tasks参数描述
reachCondition参数描述
type
true
String
达成条件(sign:签到,online:在线时长)
amount
true
Integer
达成数值
rewardSetting参数描述
type
true
String
cash,custom,nothing
amount
true
Integer
奖励数值(type为cash时,现金单位是分)
limit
false
Integer
奖励设置
customReward
false
String
自定义奖励,非必填
error参数描述
code
Integer
错误代码,用于确定具体的错误原因
desc
String
错误描述,与 error.code 对应
Java请求示例
快速接入基础代码请下载相关依赖源码, 点击下载源代码 ,下载后加入到自己的源码工程中即可。测试用例中的HttpUtil.java 和 LiveSignUtil.java 都包含在下载文件中。
强烈建议您使用直播Java SDK完成API的功能对接,直播Java SDK 对API调用逻辑、异常处理、数据签名、HTTP请求线程池进行了统一封装和优化。
private final Logger log = LoggerFactory.getLogger(getClass());
/**
* 删除任务奖励活动
* @throws IOException
* @throws NoSuchAlgorithmException
*/
@Test
public void pageTaskRewardTest() throws IOException, NoSuchAlgorithmException {
//公共参数,填写自己的实际参数
String appId = super.appId;
String appSecret = super.appSecret;
String timestamp = String.valueOf(System.currentTimeMillis());
Integer channelId = 4990862;
Integer pageSize = 10;
Integer pageNumber = 1;
//业务参数
String url = "https://api.polyv.net/live/v4/channel/task-reward-activity/page";
//http 调用逻辑
Map<String, String> requestMap = new HashMap<>();
requestMap.put("appId", appId);
requestMap.put("timestamp", timestamp);
requestMap.put("channelId", channelId);
requestMap.put("pageSize", pageSize);
requestMap.put("pageNumber", pageNumber);
requestMap.put("sign", LiveSignUtil.getSign(requestMap, appSecret));
String response = HttpUtil.get(url, requestMap);
log.info("测试任务奖励活动分页查询成功:{}", response);
//do somethings
}
响应示例
系统全局错误说明详见全局错误说明
成功示例
{
"code": 200,
"status": "success",
"requestId": "aa9f6d7d-b67b-45de-b5d6-4e0302e4c609",
"data": {
"pageNumber": 1,
"pageSize": 10,
"totalPages": 1,
"totalItems": 3,
"contents": [
{
"activityId": 1519,
"userId": "cc167950af",
"channelId": 4990862,
"activityName": "123",
"activityMode": 1,
"taskRule": 2,
"status": 0,
"startTime": 1720611960000,
"endTime": 1720623600000,
"tasks": [
{
"taskId": 4827,
"sort": 1,
"startTime": 1720611960000,
"endTime": 1720623600000,
"reachCondition": {
"type": "sign",
"amount": 1
},
"rewardSetting": {
"type": "cash",
"amount": 30,
"limit": 1,
"customReward": ""
}
},
{
"taskId": 4828,
"sort": 2,
"startTime": 1720611960000,
"endTime": 1720623600000,
"reachCondition": {
"type": "online",
"amount": 5
},
"rewardSetting": {
"type": "cash",
"amount": 30,
"limit": -1,
"customReward": ""
}
}
]
},
{
"activityId": 1518,
"userId": "cc167950af",
"channelId": 4990862,
"activityName": "解锁任务",
"activityMode": 1,
"taskRule": 1,
"status": 0,
"startTime": 1720611300000,
"endTime": 1720611849000,
"tasks": [
{
"taskId": 4824,
"sort": 1,
"startTime": 1720611300000,
"endTime": 1720612800000,
"reachCondition": {
"type": "sign",
"amount": 1
},
"rewardSetting": {
"type": "nothing",
"amount": 0,
"limit": 0,
"customReward": ""
}
},
{
"taskId": 4825,
"sort": 2,
"startTime": 1720611300000,
"endTime": 1720612800000,
"reachCondition": {
"type": "online",
"amount": 1
},
"rewardSetting": {
"type": "custom",
"amount": 0,
"limit": -1,
"customReward": "自定义"
}
},
{
"taskId": 4826,
"sort": 3,
"startTime": 1720611300000,
"endTime": 1720612800000,
"reachCondition": {
"type": "online",
"amount": 2
},
"rewardSetting": {
"type": "cash",
"amount": 30,
"limit": 1,
"customReward": ""
}
}
]
},
{
"activityId": 1517,
"userId": "cc167950af",
"channelId": 4990862,
"activityName": "英文测试",
"activityMode": 1,
"taskRule": 1,
"status": 0,
"startTime": 1720608180000,
"endTime": 1720609200000,
"tasks": [
{
"taskId": 4818,
"sort": 1,
"startTime": 1720608180000,
"endTime": 1720609200000,
"reachCondition": {
"type": "sign",
"amount": 1
},
"rewardSetting": {
"type": "nothing",
"amount": 0,
"limit": 0,
"customReward": ""
}
},
{
"taskId": 4819,
"sort": 2,
"startTime": 1720608180000,
"endTime": 1720609200000,
"reachCondition": {
"type": "online",
"amount": 1
},
"rewardSetting": {
"type": "custom",
"amount": 0,
"limit": -1,
"customReward": "测试"
}
},
{
"taskId": 4820,
"sort": 3,
"startTime": 1720608180000,
"endTime": 1720609200000,
"reachCondition": {
"type": "online",
"amount": 2
},
"rewardSetting": {
"type": "cash",
"amount": 30,
"limit": -1,
"customReward": ""
}
},
{
"taskId": 4821,
"sort": 4,
"startTime": 1720608180000,
"endTime": 1720609200000,
"reachCondition": {
"type": "online",
"amount": 3
},
"rewardSetting": {
"type": "cash",
"amount": 30,
"limit": 1,
"customReward": ""
}
}
]
}
]
},
"success": true
}
异常示例
{
"code": 400,
"status": "error",
"requestId": "d310b70bc329403f87f77f9203d50f89.128.16360831552223589",
"error": {
"code": 20001,
"desc": "application not found."
},
"success": false
}
Last updated
Was this helpful?