开发 服务端 达人开放平台 批量上传任务
# 达人开放平台批量上传任务接口
更新时间:2025-03-21 16:43:08
# 1.获取access_token
接口权限说明
以下接口调用都需要对接口进行鉴权,即在请求接口时传入固定参数:app_id 和 access_token
参数名称 | 参数位置 | 是否必须 | 参数说明 |
app_id | query param | 是 | 小程序注册后的唯一标示 |
access_token | query param | 是 | 上面获取的access_token。 |
这两个参数是作为query param拼接到url后面。
# 2.任务接口
# 2.1任务创建
method: POST
url : https://open.kuaishou.com/ (opens new window)openapi/spark/task/create
请求
请求体为JSON格式。
参数 | 类型 | 是否必填 | 含义 |
outerRequestId | string | 是 | 外部业务id,其他接口也可用这个id进行操作,务必保证唯一性 |
title | string | 是 | 任务标题(不能超过13个字) |
promotionType | int | 是 | 目前仅支持3,广告分成; 1, 小程序推广 2. 应用下载 3.广告分成 4.收入分成 5.线索转化 |
taskClassificationList | List<Integer> | 是 | 任务分类,目前列表只能填一个选项(0-20,6不可填写): 0: 数码 1: 动物 2: 美食 3: 情感 4: 读书 5: 星座 7: 旅行 8: 汽车 9: 母婴 10: 农业 11: 颜值 12: 舞蹈 13: 游戏 14: 趣味 15: 美妆 16:音乐 17: 健身 18: 影剧综 19: 动漫 20: 其他 |
indicatorId | int | 是 | 任务发布类型,任务发布类型 1.视频 2.直播 3.视频 + 直播 广告分成仅支持视频(1) |
icon | string | 是 | 任务图片,填通过"上传图片"接口获取到的uri。 图片比例:1:1 ● 图片格式:jpg/png ● 图片大小:不能超过1M |
startTime | long | 是 | 任务开始时间戳。(当天之前时间不可填写) |
endTime | long | 是 | 任务结束时间戳。 |
introduce | string | 是 | 任务介绍,最多200字。(超过报错) |
statementDesc | string | 是 | 结算说明,最多300字。(超过报错) |
examples | List<String> | 是 | 参考视频,最少1个,最多三个。例如:http://v-short.staging.kuaishou.com/9fLeSz |
resourceLink | string | 否 | 任务素材链接;当任务分类为19(影剧综)和24(短剧)时属于必填,目前仅支持百度云网盘 |
requirement | string | 否 | 达人制作视频必须遵循的要求,不得超过300字。(超过报错) |
optionRequirement | string | 否 | 达人制作视频必须遵循的要求,不得超过300字。(超过报错) |
agreementOption | int | 是 1:无协议 2:有协议 | 可以根据各业务的要求是否需要作者额外遵守某项协议;需要时设置下面两个字段。(必须填写协议名称和url) |
agreementTitle | string | 否 | 协议的名称,agreementOption值是1时必填。 |
agreementUrl | string | 否 | 协议的url,agreementOption值是1时必填。 |
mpPath | string | 是 | 小程序落地页地址 |
guideText | string | 是 | 视频左下角引导词。 |
attendLimit | int | 否 | 参与次数限制,达人可以发几个视频。 |
bindType | int | 是 | 达人类型: 0:全部达人可见任务。 2:指定达人id |
assignUserIds | List<Long> | 否 | bindType = 2时,必填达人用户,要求是快手签约达人用户, |
minFansNum | int | 否 | 要求达人粉丝数量的最小值,不填则表示无要求。 |
maxFansNum | int | 否 | 要求达人粉丝数量的最大值,不填则表示无要求。 |
divideRatio | int | 是 | 广告收入分成比例0 - 99(整数) |
baseBid | int | 否 | 底价设置金额,单位是分; |
baseBidCondition | string | 否 | 底价结算要求,达到该要求时,可以按底价给大人结算;目前仅支持视频播放量,格式为: “vv:1000”,即播放量大于1000时满足要求。 |
platforms | List<Integer> | 否 | 任务展示的平台,默认星火平台 1.星火平台 2.撮合小程序 |
响应
返回JSON
参数 | 类型 | 描述 |
code | int | 1时表示请求成功,其他表示异常 |
message | string | 一些提示信息,异常时会告知异常原因 |
data | json对象 | 返回的业务数据 |
outerRequestId | string | 业务传过来的外部id,与taskId一一对应 |
taskId | int | 达人开放平台的任务id |
{
"code": 1,
"message": "成功",
"data": {
"outerRequestId": "dd00",
"taskId": 1307,
"appId": "ks707065143182458884"
}
}
# 2.2修改任务
method: POST
url : https://open.kuaishou.com/openapi/spark/task/edit(opens new window) (opens new window)
请求
请求体为JSON格式。
参数 | 类型 | 是否必填 | 含义 |
outerRequestId | string | 否 | 外部业务id,创建任务时传的id,与taskId二者传1个即可。 |
taskId | long | 否 | 创建任务时返回的任务id,与outerRequestId二者传1个即可。 |
title | string | 否 | 任务标题 |
taskClassificationList | List<Integer> | 否 | 任务分类 |
introduce | string | 否 | 任务介绍 |
statementDesc | string | 否 | 结算说明 |
examples | List<String> | 否 | 参考视频 |
resourceLink | string | 否 | 任务素材链接 |
requirement | string | 否 | 可选要求 |
optionRequirement | string | 否 | 必选要求 |
endTime | long | 否 | 任务结束时间 |
platforms | list<Ineger> | 否 | 展示平台 |
响应
{
"code": 1,
"message": "成功",
"data": null
}
# 2.3任务查询
method: POST
url : https://open.kuaishou.com/openapi/spark/task/query (opens new window)
请求
请求体为JSON格式。
参数 | 类型 | 是否必填 | 含义 |
outerRequestId | string | 否 | 外部业务id,创建任务时传的id,与taskId二者传1个即可。 |
taskId | long | 否 | 创建任务时返回的任务id,与outerRequestId二者传1个即可。 |
响应
响应体为JSON格式,大部分数据字段、值与创建时含义相同。
新增与状态相关的信息:
字段 | 类型 | 含义 |
generalStatus | int | 枚举值,可以根据这个状态处理业务流程: 待支付 待上线 进行中 待结束 已结束 已终止 |
detailStatus | int | detailStatus是对generalStatus进一步的细分,有可能会新增状态,业务逻辑上不要太依赖。 10: 待支付 20:待上线 30:进行中 40: 待结束 - 预算超过阈值 41:待结束-任务停止接单 50:已结束-任务到期 60:已终止-任务开始前未支付 61:已终止-任务超时未支付 62:已终止-预算消耗完 63:已终止-审核拒绝 |
statusDesc | string | 状态的中文描述 |
auditSuggestion | string | 审核建议 |
attendUserCount | Integer | 参与用户数量 |
attendPhotoCount | Integer | 参与作品数量 |
userMaxIncome | Integer | 用户最大收益(分) |
{
"code": 1,
"message": "成功",
"data": {
"outerRequestId": "dddd2",
"title": "测试title",
"promotionType": 3,
"taskClassificationList": [
1
],
"indicatorId": 1,
"icon": "/xxxx/xxxx.jpeg",
"startTime": 1670732328000,
"endTime": 1671596328000,
"introduce": "这里是介绍",
"statementDesc": "结算描述",
"examples": [
"http://v-short.kuaishou.****.com/9fLeSz"
],
"requirement": "xxxx",
"optionRequirement": "xxxx",
"agreementOption": 1,
"agreementTitle": null,
"agreementUrl": null,
"mpPath": "/page/API/xxx",
"guideText": null,
"attendLimit": 0,
"bindType": 0,
"assignUserIds": null,
"minFansNum": 1000,
"maxFansNum": 100000,
"divideRatio": 70,
"baseBid": 1000,
"baseBidCondition": "vv:2000",
"taskId": 1119,
"iconUrl": "http://xxx.kuaishou.com/xx/xxx.jpeg",
"generalStatus": 2,
"detailStatus": 20,
"detailReason": "",
"statusDesc": "待上线"
}
}
# 2.4停止任务
只能停止进行中的任务。
method: POST
url : https://open.kuaishou.com/openapi/spark/task/stop(opens new window) (opens new window)
请求
请求体为JSON格式。
参数 | 类型 | 是否必填 | 含义 |
outerRequestId | string | 否 | 外部业务id,创建任务时传的id,与taskId二者传1个即可。 |
taskId | long | 否 | 创建任务时返回的任务id,与outerRequestId二者传1个即可。 |
响应
{
"code": 500009,
"message": "只有进行中的任务才可以进行停止接单",
"data": null
}
# 2.5上传图片
上传任务封面,要求图片比例是1:1,5MB以内,格式jpg/png。
method: POST
请求
url : https://open.kuaishou.com/openapi/spark/task/uploadImg (opens new window)
contentType:multipart/form-data
参数 | 类型 | 是否必填 | 含义 |
file | 文件 | 是 | 图片 |
参考curl
curl --location --request POST 'open.kuaishou.com/openapi/spark/task/uploadImg?access_token=yourtoken&app_id=yourappId' \
--form 'file=@"/Users/xxx/Desktop/examples.jpeg"'
响应
icon需要创建任务时带入。
{
"code": 1,
"message": "成功",
"data": {
"icon": "/kos/nlav100116/xxxx.jpeg"
}
}