Appearance
03-自定义大纲生成PPT
支持传入自定义的 PPT 标题及大纲结构,由系统基于输入内容智能生成对应的 PPT 内容与页面排版
📌 使用前提
- 需准备好自定义的标题与一级大纲(二级大纲可选)
- 内容部分(可选)可用于细化控制每一页的文本/结构/图片,若缺失,系统将自动根据大纲生成合理内容
🧭调用流程
1.📥PPT文档生成(/apps/ppt-create
)
接口说明
- 接口地址:
https://saas.api.yoo-ai.com/apps/ppt-create
- 请求方式: POST
请求参数
Header
参数名 | 类型 | 描述 | 示例值 |
---|---|---|---|
Authorization | string | Authorization - Bearer Token | Bearer Yoo-xxxxxxxxx |
Body参数(
application/json
)
参数名 | 类型 | 必填 | 描述 | 默认值 |
---|---|---|---|---|
font_name | string | N | 字体(黑体、宋体、仿宋、幼圆、楷书、隶书) | 黑体 |
cover_id | string | N | 模板ID(通过“AI模板生成方案”接口获取) | |
language | string | N | en-US(英文),zh-TW(繁体中文) | 简体中文 |
color | string | N | PPT模板主题色(紫色/红色/橙色/黄色/绿色/青色/蓝色/粉色) | 随机 |
user_name | string | N | 作者名 | 尤小优 |
ai_picture | bool | N | 是否使用AI生成图片 | False |
custom_data | object | Y | 自定义大纲结构,具体看custom_data表格 |
custom_data
参数名 | 类型 | 必填 | 描述 | 默认值 |
---|---|---|---|---|
title | string | Y | 标题 | |
sub_title | string | N | 副标题 | |
author | string | N | 作者 | 尤小优 |
catalogs | array | Y | 大纲,具体看catalogs表格 | |
contents | array | N | 大纲对应的详细内容,可选,如未传入将由AI自动生成,具体看contents表格 |
catalogs
参数名 | 类型 | 必填 | 描述 | 默认值 |
---|---|---|---|---|
catalog | string | Y | 一级大纲 | |
sub_catalog | array | N | 该一级大纲下的二级大纲 可以为空,但要尽量保证所有一级大纲下都有或者都没有二级大纲 |
contents
若未传入
contents
字段,系统将依据catalogs
中的大纲自动生成内容。
参数名 | 类型 | 必填 | 描述 | 默认值 |
---|---|---|---|---|
catalog_index | int | Y | 属于哪个一级大纲,从0开始 | |
sub_catalog_index | int | Y | 属于一级大纲下的第几个二级大纲,从0开始 如果没有二级大纲可传0或不传 | |
content | rray (string) array (object key-value) string | Y | 支持3种格式: array (string): 所有文本会以换行连接进行显示(图文)array (object key-value): 会以图示显示;或者key+value由上到下排列图文显示,key会高亮;图示与图文概率随机string: 直接显示一段文本(图文) | |
picture | array (string:url) | N | 要显示的图片地址,尽量不要超过3张 |
结构示例
json
{
"custom_data": {
"title": "标题",
"sub_title": "副标题",
"author": "作者",
"catalogs": [{
"catalog": "一级大纲1",
"sub_catalog": ["一级大纲1-二级大纲1"]
}, {
"catalog": "一级大纲2",
"sub_catalog": ["一级大纲2-二级大纲1"]
}],
"contents": [{
"catalog_index": 0,
"sub_catalog_index": 0,
"content": ["一级大纲1-二级大纲1-内容1", "一级大纲1-二级大纲1-内容2"]
}, {
"catalog_index": 1,
"sub_catalog_index": 0,
"content": [{
"key": "一级大纲2-二级大纲1-小标题1",
"value": "一级大纲2-二级大纲1-子内容1"
}, {
"key": "一级大纲2-二级大纲1-小标题2",
"value": "一级大纲2-二级大纲1-子内容2"
}, {
"key": "一级大纲2-二级大纲1-小标题3",
"value": "一级大纲2-二级大纲1-子内容3"
}]
}]
},
"font_name": "黑体",
"language":"en-US",
"color": "蓝色",
"user_name":"张三"
}
请求示例
json
{
"custom_data": {
"title": "父亲节营销活动规划案",
"sub_title": "Father's Day Marketing Activity Plan",
"author": "Launini",
"catalogs": [{
"catalog": "社会责任与品牌形象",
"sub_catalog": ["公益慈善活动"]
}, {
"catalog": "营销活动策划",
"sub_catalog": ["活动主题与定位"]
}],
"contents": [{
"catalog_index": 0,
"sub_catalog_index": 0,
"content": ["通过父亲节策划的公益慈善活动,公司形象显著提升,社会认可度提高20%,增强了品牌形象。", "积极履行社会责任,父亲节公益活动引发公众共鸣,品牌影响力扩大30%,树立了正面形象。"]
}, {
"catalog_index": 1,
"sub_catalog_index": 0,
"content": [{
"key": "明确活动目标受众",
"value": "父亲节营销活动需针对25-45:岁的主力消费群体,以父爱为主题,吸引家庭消费者。"
}, {
"key": "围绕家庭亲情定位",
"value": "活动主题定位在“家的温馨,父爱如山”,强调家庭情感,符合节日核心价值,提升品牌形象。"
}, {
"key": "定位核心消费群体",
"value": "父亲节营销主要针对25-45:岁成家立业的男性群体,通过数据分析确定核心消费者,精准营销。"
}]
}]
},
"font_name": "黑体",
"language":"en-US",
"color": "蓝色",
"user_name":"张三"
}
响应参数
参数名 | 类型 | 描述 |
---|---|---|
code | integer | 状态码 |
msg | string | 响应消息 |
data | object | 数据体 |
data.id | string | 任务 ID |
响应示例
json
{
"code": 200,
"msg": "success",
"data": {
"id": "KfvKk2ffTNPjCv8uttV7Bqe3DGAMnMVz"
}
}
2. 🔄 获取生成PPT结果(/apps/ppt-result
)
接口说明
- 接口地址:
https://saas.api.yoo-ai.com/apps/ppt-result
- 请求方式: GET
请求参数
Header
参数名 | 类型 | 描述 | 示例值 |
---|---|---|---|
Authorization | string | Authorization - Bearer Token | Bearer Yoo-xxxxxxxxx |
Query参数
参数名 | 类型 | 必填 | 描述 | 默认值 |
---|---|---|---|---|
id | string | Y | 任务ID |
请求示例
json
{
"id":"KfvKk2ffTNPjCv8uttV7Bqe3DGAMnMVz"
}
响应参数
参数名 | 类型 | 描述 |
---|---|---|
code | integer | 状态码 |
msg | string | 响应消息 |
data | object | 数据体 |
data.id | string | 任务id |
data.images_url | array | PPT中所有的图片URL和时间戳的数组 |
data.note_status | int | PPT备注状态(0-无备注,1-有备注) |
data.introduce | string | PPT的大纲 |
data.ppt_title | string | PPT标题 |
data.page_count | int | PPT的页数 |
data.progress | int | 生成进度,100表示已完成 |
data.status | int | 状态(1-进行中|2-已完成|3-生成失败) |
data.first_image_up_at | string | 第一张图片上传的时间 |
data.created_at | string | PPT创建的时间 |
data.updated_at | string | PPT最后更新的时间 |
data.state_description | string | 状态描述(生成已完成|正在生成演示内容) |
data.process_url | string | 生成进度的URL |
data.preview_url | string | PPT预览的URL,仅用于**【内部测试预览】** |
响应示例
json
{
"code": 200,
"msg": "success",
"data": {
"id": "KfvKk2ffTNPjCv8uttV7Bqe3DGAMnMVz",
"images_url": [
{
"url": "https://file.static.yoojober.cn/chatppt/20250530/cw10psszt5axs.png",
"time": 1748589454
},
{
"url": "https://file.static.yoojober.cn/chatppt/20250530/ux6ot9cp9zu8r.png",
"time": 1748589455
},
{
"url": "https://file.static.yoojober.cn/chatppt/20250530/19hcayhxitaxm.png",
"time": 1748589456
},
{
"url": "https://file.static.yoojober.cn/chatppt/20250530/7dlj06uemckf4.png",
"time": 1748589464
},
{
"url": "https://file.static.yoojober.cn/chatppt/20250530/b1bzkoh6ebzqe.png",
"time": 1748589458
}
],
"note_status": 0,
"introduce": "父亲节营销活动规划案\r\n社会责任与品牌形象\r\n公益慈善活动\r\n社会责任与品牌形象\r\n活动主题与定位\r\n",
"ppt_title": "父亲节营销活动规划案",
"page_count": 7,
"progress": 80,
"status": 1,
"first_image_up_at": "2025-05-30 15:17:34",
"created_at": "2025-05-30 15:17:27",
"updated_at": "2025-05-30 15:17:44",
"state_description": "正在输出文件...",
"process_url": "https://chatppt.yoo-ai.com/generateResults?generateID=KfvKk2ffTNPjCv8uttV7Bqe3DGAMnMVz",
"preview_url": "https://chatppt.yoo-ai.com/generateResults?generateID=KfvKk2ffTNPjCv8uttV7Bqe3DGAMnMVz"
}
}
3.⬇️PPT下载(/apps/ppt-download
)
接口说明
- 接口地址:
https://saas.api.yoo-ai.com/apps/ppt-download
- 请求方式: GET
请求参数
Header
参数名 | 类型 | 描述 | 示例值 |
---|---|---|---|
Authorization | string | Authorization - Bearer Token | Bearer Yoo-xxxxxxxxx |
Query参数
参数名 | 类型 | 必填 | 描述 | 默认值 |
---|---|---|---|---|
id | string | Y | 任务ID |
请求示例
json
{
"id":"KfvKk2ffTNPjCv8uttV7Bqe3DGAMnMVz"
}
响应参数
参数名 | 类型 | 描述 |
---|---|---|
code | integer | 状态码 |
msg | string | 响应消息 |
data | object | 数据体 |
data.download_url | string | 下载链接 |
响应示例
json
{
"code": 200,
"msg": "success",
"data": {
"download_url": "https://yoo-web-public.gz.bcebos.com/chatppt/20250530/3m498n5y8iej9.pptx?authorization=bce-auth-v1%2FALTAK7YW57hmnPzhWsz3GT3DUV%2F2025-05-30T07%3A18%3A48Z%2F3600%2F%2F7eae569416a20afc5df2e7c74495b2c42f94312c0c990769bc1f56148e55248f"
}
}
4.🛠️PPT编辑器(/apps/ppt-editor
)
接口说明
- 接口地址:
https://saas.api.yoo-ai.com/apps/ppt-editor
- 请求方式: POST
请求参数
Header
参数名 | 类型 | 描述 | 示例值 |
---|---|---|---|
Authorization | string | Authorization - Bearer Token | Bearer Yoo-xxxxxxxxx |
Body参数(
application/json
)
参数名 | 类型 | 必填 | 描述 | 默认值 |
---|---|---|---|---|
id | string | Y | 任务ID | |
expire | string | Y | URL有效时间-秒 | 86400 |
请求示例
json
{
"id":"dNXxxaKDpSXFcGsufRyJ6w6nBxzmsyz6",
"expire":86400
}
响应参数
参数名 | 类型 | 描述 |
---|---|---|
code | integer | 状态码 |
msg | string | 响应消息 |
data | object | 数据体 |
data.url | string | 编辑器URL链接 |
data.expire_time | string | 链接到期时间 |
响应示例
- PPT文件已经渲染完成:
json
{
"code": 200,
"msg": "success",
"data": {
"url": "https://aigc.yoo-ai.com/editor?id=api%3Acuymb9QUQ6BEuPGp3FKH8ZmxQzGVVM6e&token=HVMT7NWTGD7TWGRPPZT8TJFBRQUTEJJQ",
"expire_time": "2025-06-04 15:07:11"
}
}
- PPT正在生成中:
json
{
"code":204,
"msg":"请等待PPT生成完成...",
"data":{}
}