模板相关接口
获取模板列表
使用该接口,获取夺目模版列表数据。
GET https://api.bestminr.com/api/duomu/themes
请求参数
参数名 | 类型 | 是否必填 | 说明 |
---|---|---|---|
access_token | String | 是 | 请求接口所需凭证 |
keyword | String | 否 | 模版名称 |
aspect_raito | String | 否 | 模版比例 |
page | Int | 否 | 页数 |
logo_theme | Boolean | 否 | 筛选logo场景,值为true时只返回logo场景 |
调用示例
curl --request GET \
--url "https://api.bestminr.com/api/duomu/themes?access_token=<access_token>&keyword=<keyword>&aspect_raito=<aspect_raito>&page=<page>"
返回数据
返回数据中每个模板详细信息见模板数据说明
{
"page_info": {
"total_page": 5, // 列表总页数
"total": 46, // 模版总数
"per_page": 10, // 每页多少个模版
"page": 1 // 当前页数
},
"themes": [
{ /* 每个模板的详细数据 */ },
...
]
}
获取单个模版数据
根据模版id获取具体某个模版信息。
GET https//api.bestminr.com/api/duomu/themes/<theme_id>
请求参数
参数名 | 类型 | 是否必填 | 说明 |
---|---|---|---|
access_token | String | 是 | 请求接口所需凭证 |
调用示例
curl --request GET \
--url "https://api.bestminr.com/api/duomu/themes/<theme_id>?access_token=<access_token>"
返回数据
返回数据中每个模板详细信息见模板数据说明
{
"theme": { /* 模板数据 */ }
}
模板数据说明
每个模板由若干个场景组成,因此模板themes
字段分为模板基本信息和场景信息,具体字段说明如下:
模板基本信息
[
{
"id": "giD", // 模板 id
"name": "健身抖音广告", // 模版名称
"description": "网红款抖音广告模板", // 描述
"thumbnail_img": "", // 模版预览图 url
"sample": "", // 模版样片 url
"aspect_ratio": "9/16", // 模版画面比例,模板目前有 16/9,9/16,3/4,1/1 四种比例
"theme_scenes": [
{ /* 模板场景信息 */ },
...
]
},
...
]
模板场景信息
每个模版包含若干场景,场景有图片、文字、视频和拼图四种类型image
, text
, video
, collage
,拼图场景可以添加多个素材
模板场景信息theme_scenes
字段如下:
[
{
"name": "giD_5_1", // 场景名
"type": "image", // 场景类型:image, text, video, collage
"resource_type": "image", // 场景使用素材类型:image, video, text
"description": "单张照片", // 场景描述
"thumbnail_img": "", // 场景预览图 url
"thumbnail_video": "", // 场景预览视频 url
/* 场景配置信息 */
"sub_scene_config": {
"layout": "A1:1x1/2+0+0,A2:1x1/2+0+1/2", // 拼图场景布局信息,非拼图场景为 null
"resource_count": 2 // 场景所需素材数
},
/* 场景文字配置信息 */
"text_config": {
"subtitle_support": true // 配文是否支持副标题
},
/* 场景时长配置 */
"duration_config": {
"recommend_duration": 65 // 渲染视频使用该场景推荐时长,单位为帧,每秒25帧
}
},
...
]
拼图场景说明
- 如果拼图场景
resource_type
为video
,这个场景既可以使用图片素材,也可以使用视频素材。 - 如果拼图场景
resource_type
为image
,这个场景只可以使用图片素材,不能使用视频素材。