跳到主要内容

创建素材拉取任务

1.接口说明

此接口用于创建素材拉取任务。

2.请求地址

https://digitbot.bokecc.com/api/material/fetchtask/create

3.请求方式

POST application/json

4.请求参数

(1).公共参数,参考服务说明

(2).接口参数

①.Query参数:通过URL参数传递。

参数名类型必需说明
versionString接口版本号,当前支持版本:1.0.0。

②.Body参数:通过请求Body传递,JSON格式。

参数名类型必需说明
projectIdString项目ID。
typeInteger素材类型,1=自定义图片背景、2=自定义视频背景、3=自定义图片贴纸、4=驱动音频、5=ppt文档
fileUrlString文件地址,最多500个字符
filenameString文件名,必须带扩展名(后缀名),扩展名与type要求一致,见表格下方说明
callbackUrlString素材拉取结果回调地址,无此参数时不回调,回调重试规则参见回调说明
businessIdString客户透传业务id, 回调时作为参数回传给客户接口

素材类型type允许的文件扩展名:

  • type=1 或 type=3 时filename扩展名允许为: jpg, jpeg, png

  • type=2 时filename扩展名允许为: mp4

  • type=4 时filename扩展名允许为: ape, mp3, wav, flac, wma, aac

  • type=5 时filename扩展名允许为: ppt, pptx

备注:素材任务执行成功时将根据type参数生成素材关联记录,type=1时生成自定义图片背景记录,type=2时生成自定义视频背景记录,type=3时生成自定义图片贴纸记录,type=4时生成驱动音频记录,type=5时生成ppt文档记录。素材任务执行失败时不生成记录。

5.请求示例

POST https://digitbot.bokecc.com/api/material/fetchtask/create?accountId=xxx&version=1.0.0&hash=xxx&time=xxx HTTP/1.1
{
"projectId": "xxxx",
"type": 1,
"fileUrl": "xxxxxxxxxxxxxxxx",
"filename": "春天.png",
"callbackUrl": "xxxxxxxxxxxxxxxx",
"businessId": "8888"
}

6.响应示例

{
"taskId": "xxx"
}

7.响应说明

字段名类型说明
taskIdString任务ID。