Appearance
添加直播任务
| 拥有此API的权限集 |
|---|
| 直播管理-增删改 |
请求方式及url
- 请求方式:
POST - 请求头:
Content-Type:application/json - 接口地址:
https://api.xiaoe-tech.com/xe.alive.marketing.task.create/1.0.0 - 频率限制:
10秒3000次
接口调试
请求参数
响应结果
暂无响应数据
请求参数
| 参数名 | 必选 | 类型 | 说明 |
|---|---|---|---|
| access_token | 是 | string | 专属token |
| alive_id | 是 | string | 直播ID |
| start_at | 是 | string | 开始时间 |
| end_at | 是 | string | 结束时间 |
| task_module | 是 | int | 任务模块:0-单项任务,1-组合任务 |
| task_is_major | 是 | int | 是否主任务:0-是,1-否 |
| level_member_rank | 否 | array | 等级会员条件 |
| reward_type | 是 | int | 奖励类型:1=积分,2=优惠券,3=红包,4=课程/商品,5=自定义奖品 |
| reward_value | 是 | string | 奖励值:积分数值、优惠券码、红包、自定义奖品(JSON字符串) |
| reward_frequency | 否 | string | 奖励发放频率 |
| rule_type | 否 | int | 规则类型 |
| rule_config | 否 | array | 规则配置 |
| is_order | 否 | int | 是否按顺序完成:0-否,1-是 |
| task_title | 否 | string | 任务标题,组合任务(task_module=1)需传 |
| child_tasks | 否 | string | 子任务,组合任务(task_module=1)需传(JSON字符串) |
单项任务/子任务参数说明:
task_type- 任务类型:1=观看任务,2=互动任务,3=消费任务,4=活跃任务,仅单项任务或子任务需传task_condition- 任务条件,仅单项任务或子任务需传:
- 观看任务:填写具体分钟值(如 "3" 表示观看3分钟)
- 互动任务:1-评论,2-分享(21分享拉人,22分享拉新),3-点赞
- 消费任务:4-下单笔数,5-消费金额
- 活跃任务:6-打赏,7-投票,8-问卷,9-签到,10-答题
组合任务主任务说明:
- 组合任务的主任务(task_is_major=0)无需传 task_type、task_condition
- 无序组合(is_order=0):主任务设置统一奖励(reward_type、reward_value),子任务无奖励
- 有序组合(is_order=1):主任务可设置奖励(reward_type、reward_value),每个子任务也可单独设置奖励
请求示例
单项任务示例
json
{
"access_token": "xe_xxxxx",
"alive_id": "l_xxxxx",
"start_at": "2026-03-01 00:00:00",
"end_at": "2026-03-03 00:00:00",
"task_module": 0,
"task_is_major": 0,
"task_type": 1,
"task_condition": "3",
"reward_type": 5,
"reward_value": "{\"prizeName\":\"自定义奖品名称\",\"prizeHint\":\"恭喜您,获得奖品\",\"defaultImg\":1,\"prizeImg\":\"https://example.com/image/prize.png\",\"wechat\":\"0\",\"qrcode\":\"1\",\"qrcodeImg\":\"https://example.com/image/qrcode.png\",\"wechatNum\":\"\",\"prizeNum\":1,\"prizeCusTomTitle\":\"\"}",
"rule_type": 0,
"rule_config": []
}无序组合任务示例
json
{
"access_token": "xe_xxxxx",
"alive_id": "l_xxxxx",
"start_at": "2026-03-01 00:00:00",
"end_at": "2026-03-07 00:00:00",
"task_module": 1,
"task_is_major": 0,
"reward_type": 1,
"reward_value": "1",
"is_order": 0,
"task_title": "任务包",
"child_tasks": "[{\"alive_id\":\"l_xxxxx\",\"start_at\":\"2026-03-01 00:00:00\",\"end_at\":\"2026-03-07 00:00:00\",\"task_module\":1,\"task_is_major\":1,\"is_order\":0,\"task_type\":1,\"task_condition\":\"10\",\"rule_type\":0,\"rule_config\":[]},{\"alive_id\":\"l_xxxxx\",\"start_at\":\"2026-03-01 00:00:00\",\"end_at\":\"2026-03-07 00:00:00\",\"task_module\":1,\"task_is_major\":1,\"is_order\":0,\"reward_frequency\":\"1\",\"task_type\":4,\"task_condition\":\"9\",\"rule_type\":0,\"rule_config\":[]}]",
"rule_type": 0,
"rule_config": []
}有序组合任务示例
json
{
"app_id": "apptrfbbm2m8971",
"alive_id": "l_696ef6c1e4b0694c5b78ba7b",
"start_at": "2026-03-11 00:00:00",
"end_at": "2026-03-13 00:00:00",
"task_module": 1,
"task_is_major": 0,
"live_task_id": 1385878,
"reward_type": 5,
"reward_value": "{\"prizeName\":\"奖品2\",\"prizeHint\":\"恭喜您,获得奖品\",\"defaultImg\":1,\"prizeImg\":\"https://commonresource-1252524126.cdn.xiaoeknow.com/image/me2fxg750uaa.png\",\"wechat\":\"1\",\"qrcode\":\"0\",\"qrcodeImg\":\"\",\"wechatNum\":\"3414141\",\"prizeNum\":1,\"prizeCusTomTitle\":\"\"}",
"is_order": 1,
"task_title": "任务包",
"child_tasks": "[{\"alive_id\":\"l_696ef6c1e4b0694c5b78ba7b\",\"start_at\":\"2026-03-11 00:00:00\",\"end_at\":\"2026-03-13 00:00:00\",\"task_module\":1,\"task_is_major\":1,\"reward_type\":5,\"reward_value\":\"{\\\"prizeName\\\":\\\"1\\\",\\\"prizeHint\\\":\\\"恭喜您,获得奖品\\\",\\\"defaultImg\\\":1,\\\"prizeImg\\\":\\\"https://commonresource-1252524126.cdn.xiaoeknow.com/image/me2fxg750uaa.png\\\",\\\"wechat\\\":\\\"0\\\",\\\"qrcode\\\":\\\"1\\\",\\\"qrcodeImg\\\":\\\"https://wechatapppro-1252524126.cdn.xiaoeknow.com/apptrfbbm2m8971/image/b_u_cte16f953tt0jfc429e0/4o147xmg3536oq.jpg\\\",\\\"wechatNum\\\":\\\"\\\",\\\"prizeNum\\\":1,\\\"prizeCusTomTitle\\\":\\\"\\\"}\",\"is_order\":1,\"task_type\":1,\"task_condition\":\"10\",\"rule_type\":0,\"rule_config\":[]},{\"alive_id\":\"l_696ef6c1e4b0694c5b78ba7b\",\"start_at\":\"2026-03-11 00:00:00\",\"end_at\":\"2026-03-13 00:00:00\",\"task_module\":1,\"task_is_major\":1,\"reward_type\":1,\"reward_value\":\"1\",\"is_order\":1,\"reward_frequency\":\"1\",\"task_type\":4,\"task_condition\":\"9\",\"rule_type\":0,\"rule_config\":[]}]",
"rule_type": 0,
"rule_config": []
}返回参数
| 参数名 | 必选 | 类型 | 说明 | 备注 |
|---|---|---|---|---|
| code | 是 | int | 返回码 | 0-成功,其他失败 |
| msg | 是 | string | 返回信息 | ... |
| data | 是 | json对象 | 返回值 | ... |
data 对象
| 参数名 | 类型 | 说明 |
|---|---|---|
| task_id | int | 主任务ID |
| alive_id | string | 直播ID |
备注
code=0时,msg:code!=0时,msg:创建直播任务失败
返回示例
json
{
"code": 0,
"msg": "操作成功",
"data": {
"task_id": 1975339,
"alive_id": "l_xxxxx"
}
}