模板
接入前提
获取调用 API 所需的 token 请参考 API 鉴权
模板接口用于在作品生成前展示可选模板。系统模板面向通用场景;企业模板只有在接入方已配置企业模板资产时才可使用。
| 能力 | 使用时机 |
|---|---|
| 模板套装列表筛选项 | 用户进入模板选择页前,用于获取颜色、风格、场景等筛选条件 |
| 模板套装列表 | 用户按筛选条件选择系统模板时使用 |
| 企业模板套装列表 | 接入方需要展示企业模板时使用 |
作品生成时可通过 template_id 和 template_type 指定模板。template_type=1 表示系统模板,template_type=2 表示企业模板。
使用边界
| 目标 | 推荐接口 |
|---|---|
| 展示模板筛选条件 | 模板套装列表筛选项 |
| 展示系统模板 | 模板套装列表 |
| 展示企业模板 | 企业模板套装列表 |
| 用模板生成 PPT | 在 作品生成 中传入 template_id 和 template_type |
模板选择只有在 template_id 和 template_type 一起传给作品生成接口后才真正生效。
模板套装列表筛选项
筛选项接口说明
| 接口描述 | 此接口返回模板套装列表筛选项,用于模板套装列表接口的筛选项数据填充 | ||
| 接口地址 | /api/template_component/suit/select | 请求方式 | GET |
| 权限校验 | 是 | 请求参数 | json |
| 图片示例 | |||
请求示例
ts
curl --location --request GET 'https://co.aippt.cn/api/template_component/suit/select' \
--header 'x-api-key: <apiKey>' \
--header 'x-channel: <channel>' \
--header 'x-token: <token>'响应内容
响应示例
ts
{
"code": 0,
"data": {
"colour": [
{
"id": 1,
"name": "橙色",
"en_name": "Orange",
"code": "#FCC462"
},
{
"id": 2,
"name": "红色",
"en_name": "",
"code": "#FB6E6F"
}
],
"suit_style": [
{
"id": 1,
"title": "扁平简约"
},
{
"id": 2,
"title": "商务科技"
}
],
"suit_scene": [
{
"id": 6,
"title": "教育培训"
}
]
},
"msg": "ok"
}模板套装列表
系统模板接口说明
| 接口描述 | 此接口返回模板套装列表,选中后的套装用于调用 PPT生成 接口。 | ||
| 接口地址 | /api/template_component/suit/search | 请求方式 | GET |
| 权限校验 | 是 | 请求参数 | json |
| 图片示例 | |||
请求参数
请求示例
ts
curl --location --request GET 'https://co.aippt.cn/api/template_component/suit/search?colour_id&page&page_size&style_id' \
--header 'x-api-key: <apiKey>' \
--header 'x-channel: <channel>' \
--header 'x-token: <token>'响应内容
响应示例
ts
{
"code": 0,
"data": {
"pagination": {
"total": 19,
"current_page": 1,
"page_size": 2
},
"list": [
{
"id": 81,
"cover_img": "//file.isheji.com/isheji-sop/0/119/styles/20221024172110271036.jpeg"
},
{
"id": 80,
"cover_img": "//file.isheji.com/isheji-sop/0/119/styles/20221024172003597548.jpeg"
}
]
},
"msg": "ok"
}企业模板套装列表
企业模板接口说明
| 接口描述 | 此接口返回企业模板套装列表,选中后的套装用于调用 PPT生成 接口。 | ||
| 接口地址 | /api/template_component/enterprise/suit/list | 请求方式 | GET |
| 权限校验 | 是 | 请求参数 | json |
请求示例
ts
curl --location --request GET 'https://co.aippt.cn/api/template_component/enterprise/suit/list' \
--header 'x-api-key: <apiKey>' \
--header 'x-channel: <channel>' \
--header 'x-token: <token>'响应内容
响应示例
ts
{
"code": 0,
"data": {
"pagination": {
"total": 19,
"current_page": 1,
"page_size": 2
},
"list": [
{
"id": 81,
"cover_img": "//file.isheji.com/isheji-sop/0/119/styles/20221024172110271036.jpeg"
},
{
"id": 80,
"cover_img": "//file.isheji.com/isheji-sop/0/119/styles/20221024172003597548.jpeg"
}
]
},
"msg": "ok"
}