Skip to content

AI 模板替换


组 20583@1x (1)

适用场景

  • 需要提供已生成 PPT 的任务 ID,即可按照该任务 ID 的模板生成新的 PPT

步骤一:更换 PPT 模板

1.说明

接口描述更换模板
请求地址https://saas.api.yoo-ai.com/apps/ppt-create-task请求方式POST

2.请求参数

headers 请求参数

  • Token 需要在韦尼克平台创建相关应用获取
名称类型必选说明示例值
AuthorizationstringAuthorization - Bearer TokenBearer Yoo-xxxxxxxxx

Body 请求参数

参数类型必须默认值说明
idstringY原 PPT 任务 ID
cover_idstringNPPT 封面 ID(通过根据标题生成封面图预览接口获取),为空时默认随机

3.请求示例

JSON
{
    "id":"gq7zqD6QWQsBvAc4ARRS7rwTAWZvhTpf",
    "cover_id":"v2eRnb-1"
}

4.响应内容

名称类型参数描述参数示例
codeint状态码
msgstring返回信息
datastring数据体
data.idarray生成任务 ID

5.响应示例

JSON
{
    "code": 200,
    "msg": "success",
    "data": {
        "id": "nPwMzmAesETyVQrJPvb7y4Wwg6asKpMC"
    }
}

步骤 2:获取 PPT 生成结果

1.说明

  • 接口描述:通过之前生成任务的 ID 即可查询生成任务的进度,并获取对应 PPT 的预览图片。接口建议进行轮询,通过status参数获取生成状态,通过data.state_description获取进度描述,预览图片逐步生成的

  • 请求地址:https://saas.api.yoo-ai.com/apps/ppt-result

  • 请求方式:GET

2.请求参数

Headers

  • Token 需要在韦尼克平台创建相关应用获取
名称类型必选说明示例值
AuthorizationstringAuthorization - Bearer TokenBearer Yoo-xxxxxxxxx

Query 参数

名称类型必选说明
idstring任务 ID

3.请求示例

json
{
  "id": "nPwMzmAesETyVQrJPvb7y4Wwg6asKpMC"
}

4.响应内容

名称类型描述默认值
codeint状态码
msgstring返回信息
dataobject数据体
data.idstring生成任务 ID
data.input_textstring请求任务 query
data.images_urlArrayPPT 图片信息
data.images_url.urlstringPPT 图片预览地址
data.images_url.timestringPPT 图片生成时间戳
data.ppt_titlestringPPT 标题
data.page_countint总页数
data.progressint生成进度
data.statusint状态(1-进行中 2-已完成 3-生成失败)
data.created_atstring任务开始时间
data.updated_atstring最后更新时间
data.state_descriptionstring进度描述
data.process_urlstringweb 加载页面

5.响应示例

json
{
  "code": 200,
  "msg": "success",
  "data": {
    "id": "nPwMzmAesETyVQrJPvb7y4Wwg6asKpMC",
    "input_text": "生成一份网络安全ppt",
    "user_client_ip": "192.168.10.1",
    "images_url": [
      {
        "url": "https://image.yoojober.com/chatppt_business/2023-10/7848bc234337d0934cb7229586a1bd53.png",
        "time": 1697771030
      },
      {
        "url": "https://image.yoojober.com/chatppt_business/2023-10/9520959bea2d07d5f854fae1ba4eb655.png",
        "time": 1697771030
      },
      {
        "url": "https://image.yoojober.com/chatppt_business/2023-10/560484f169f101b563c4dc52abe675d9.png",
        "time": 1697771031
      },
      {
        "url": "https://image.yoojober.com/chatppt_business/2023-10/0b18abeccda8b7b3961263653a505aab.png",
        "time": 1697771046
      },
      {
        "url": "https://image.yoojober.com/chatppt_business/2023-10/61c67562f1941f8a3213b597c1e51cb0.png",
        "time": 1697771032
      },
      {
        "url": "https://image.yoojober.com/chatppt_business/2023-10/3a628745afb17cf34ab767fd16eeb498.png",
        "time": 1697771040
      },
      {
        "url": "https://image.yoojober.com/chatppt_business/2023-10/c992895758fad2db14f8aa554a03e3bd.png",
        "time": 1697771032
      },
      {
        "url": "https://image.yoojober.com/chatppt_business/2023-10/87505667281a520e84b0bba8c15c9872.png",
        "time": 1697771044
      },
      {
        "url": "https://image.yoojober.com/chatppt_business/2023-10/0e20c8441c5a367f21d7d8638e6f6fb2.png",
        "time": 1697771033
      },
      {
        "url": "https://image.yoojober.com/chatppt_business/2023-10/71abac6127183ca418f3fdffc7293d63.png",
        "time": 1697771042
      },
      {
        "url": "https://image.yoojober.com/chatppt_business/2023-10/506bafd8b1138249dd5641b918939ed7.png",
        "time": 1697771033
      },
      {
        "url": "https://image.yoojober.com/chatppt_business/2023-10/a5cdb2141c218819b1843f3f236a1f68.png",
        "time": 1697771045
      },
      {
        "url": "https://image.yoojober.com/chatppt_business/2023-10/3fe19acc08e703315630351d6d4128fd.png",
        "time": 1697771034
      },
      {
        "url": "https://image.yoojober.com/chatppt_business/2023-10/7408008b6b69d997d315eaef6382a877.png",
        "time": 1697771044
      },
      {
        "url": "https://image.yoojober.com/chatppt_business/2023-10/357fc06954426a1c4e0ea65569447617.png",
        "time": 1697771035
      },
      {
        "url": "https://image.yoojober.com/chatppt_business/2023-10/d649a2d74dc8d9628fe2c991a907ff57.png",
        "time": 1697771042
      },
      {
        "url": "https://image.yoojober.com/chatppt_business/2023-10/6d738eb507225d210b43dc94242d07f3.png",
        "time": 1697771035
      },
      {
        "url": "https://image.yoojober.com/chatppt_business/2023-10/56bbe4abf173fd632c9d3b2592f4aecb.png",
        "time": 1697771044
      },
      {
        "url": "https://image.yoojober.com/chatppt_business/2023-10/6070a613b0024e728761ede0f693cb5e.png",
        "time": 1697771036
      },
      {
        "url": "https://image.yoojober.com/chatppt_business/2023-10/da844cf3705c9a5d500cff5bca09a8cd.png",
        "time": 1697771042
      },
      {
        "url": "https://image.yoojober.com/chatppt_business/2023-10/72e3ec1b4ffa32633ed0a6b58030e41e.png",
        "time": 1697771037
      },
      {
        "url": "https://image.yoojober.com/chatppt_business/2023-10/754926389c6e39774c305802916f1223.png",
        "time": 1697771045
      },
      {
        "url": "https://image.yoojober.com/chatppt_business/2023-10/02738101d6a52dc6a381f4c0acd34b43.png",
        "time": 1697771046
      }
    ],
    "ppt_title": "网络安全框架",
    "page_count": 23,
    "progress": 100,
    "status": 2,
    "created_at": "2023-10-20 11:03:45",
    "updated_at": "2023-10-20 11:04:10",
    "state_description": "生成已完成...",
    "process_url": "https://aigc.yoo-ai.com/generateResults?urlKey=saas&generateID=acQdp8mesqQUmpQqkVHRMRffWyW7PqsW"
  }
}

步骤 3:获取 PPT 下载地址

长图、PDF 格式目前为免费开放

1.说明

接口描述获取 PPT 下载链接,支持长图、PDF、PPTX 格式
请求地址https://saas.api.yoo-ai.com/apps/ppt-download请求方式GET

2.请求参数

Headers

  • Token 需要在韦尼克平台创建相关应用获取
名称类型必选说明示例值
AuthorizationstringAuthorization - Bearer TokenBearer Yoo-xxxxxxxxx

query 参数

  • 参数备注
  • 重新生成模板-id 缓存 1 小时内
参数类型必须默认值说明
idstringPPT 生成 ID
typestringpptx下载的文件格式:png/pdf/pptx

3.请求示例

  • 下载 PPTX 格式示例:
{
  "id":"wwgqeUyZnXGMpVGqyVXWJVbRGWvsDYP5",
  "type":"pptx"
}
  • 下载长图格式示例:
{
  "id":"wwgqeUyZnXGMpVGqyVXWJVbRGWvsDYP5",
  "type":"png"
}
  • 下载 PDF 格式示例:
{
  "id":"wwgqeUyZnXGMpVGqyVXWJVbRGWvsDYP5",
  "type":"pdf"
}

4.响应内容

名称类型参数描述参数示例
codeint状态码
msgstring描述消息
dataobject数据体
data.download_urlstring下载链接

5.响应示例

json
{
  "code": 200,
  "msg": "success",
  "data": {
    "download_url": "https://download.yoojober.com/chatppt_business/2024-06/86b26b64cb6ebf7565523c9192f467a2.pptx?e=1717675120&token=8_2qFlGEVQZPpFvHdGR6gg2t9A9QZfWT9wwTl92s:cbgbknWpC2QuLzn2zqFDHjifCA4="
  }
}