创建素材拉取任务
1.接口说明
此接口用于创建素材拉取任务。
2.请求地址
https://digitbot.bokecc.com/api/material/fetchtask/create
3.请求方式
POST application/json
4.请求参数
(1).公共参数,参考服务说明。
(2).接口参数
①.Query参数:通过URL参数传递。
| 参数名 | 类型 | 必需 | 说明 |
|---|---|---|---|
| version | String | 是 | 接口版本号,当前支持版本:1.0.0。 |
②.Body参数:通过请求Body传递,JSON格式。
| 参数名 | 类型 | 必需 | 说明 |
|---|---|---|---|
| projectId | String | 是 | 项目ID。 |
| type | Integer | 是 | 素材类型,1=自定义图片背景、2=自定义视频背景、3=自定义图片贴纸、4=驱动音频、5=ppt文档 |
| fileUrl | String | 是 | 文件地址,最多500个字符 |
| filename | String | 是 | 文件名,必须带扩展名(后缀名),扩展名与type要求一致,见表格下方说明 |
| callbackUrl | String | 否 | 素材拉取结果回调地址,无此参数时不回调,回调重试规则参见回调说明 |
| businessId | String | 否 | 客户透传业务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.响应说明
| 字段名 | 类型 | 说明 |
|---|---|---|
| taskId | String | 任务ID。 |