模板
接入前提
获取调用API所需的TOKEN请参考鉴权
模板接口用于接入方在作品生成前为用户提供模板选择能力。系统模板适合通用场景,企业模板适合已配置企业模板资产的接入方。
| 能力 | 使用时机 |
|---|---|
| 模板套装列表筛选项 | 用户进入模板选择页前,用于获取颜色、风格、场景等筛选条件 |
| 模板套装列表 | 用户按筛选条件选择系统模板时使用 |
| 企业模板套装列表 | 接入方需要展示企业模板时使用 |
作品生成时可通过 template_id 和 template_type 指定模板。template_type=1 表示系统模板,template_type=2 表示企业模板。
模板套装列表筛选项
说明
| 接口描述 | 此接口返回模板套装列表筛选项,用于模板套装列表接口的筛选项数据填充 | ||
| 接口地址 | /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"
}