# 创建任务:通过PPT文件生出模版

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v1/job/template_create_by_ppt:
    post:
      summary: 创建任务:通过PPT文件生出模版
      deprecated: false
      description: |2+

          :::caution

          生成PPT模版是 **异步任务**

          该请求会生成异步任务, 并返回任务id ,此时的 `template_id` 为空

          生成时间预计: **30秒-60秒**


          需要 后续轮询调用 **获取单个任务数据** `/v1/job/get` 协议获取任务的最新状态 (推荐每隔5秒请求一次,直到任务成功)

          :::


      tags:
        - 模板相关
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                resource_id:
                  description: 上传的 pptx/ppt 文件的 资源id
                  type: string
              required:
                - resource_id
              x-apifox-orders:
                - resource_id
      responses:
        '200':
          description: 成功
          content:
            application/json:
              schema:
                type: object
                title: ResponseModel
                properties:
                  code:
                    type: integer
                    description: 错误码( 0:成功. 其它值:失败[无data数据区])
                  info:
                    type: string
                    description: 错误信息
                    examples:
                      - succ
                  request_id:
                    type: string
                    description: 请求id,用于定位请求
                    examples:
                      - 21al1389334aal4f
                  data:
                    type: object
                    properties:
                      job:
                        description: 任务消息
                        type: object
                        properties:
                          id:
                            description: '任务id  '
                            examples:
                              - 1dk13k3hgfk
                            type: string
                          title:
                            description: '标题 '
                            examples:
                              - 标题
                            type: string
                          status:
                            description: >-
                              状态 [ `queued`:排队中, `running`:进行中 , 
                              `succeeded`:完成, `failed`:失败  ]  
                            examples:
                              - succeeded
                            type: string
                          queue_wait_count:
                            description: 队列等待个数.
                            type: integer
                          progress_percent:
                            description: '进度: 0-100 , status=`running` 有效 '
                            examples:
                              - 0
                            type: integer
                          created_at:
                            description: '任务创建时间 '
                            examples:
                              - '2020-01-01T00:00:00+08:00'
                            type: string
                          finished_at:
                            description: '任务完成时间 '
                            examples:
                              - '2020-01-01T00:00:00+08:00'
                            type: string
                          ppt_url:
                            description: >-
                              生成ppt 对应的url, 注意：该链接带签名需要完整的链接才能下载,
                              `有效时间为一周,请及时下载到本地`
                            type: string
                          template_id:
                            description: (任务：生成模版才有值) 生成的模版ID, 可用用于后续生成PPT
                            type: string
                          preview_img_list:
                            type: array
                            description: PPT前3张预览图的图片列表, `有效时间为一周,请及时下载到本地`
                            items:
                              description: ''
                              type: string
                          error:
                            description: 任务错误情况下的报错信息
                            type: string
                        required:
                          - id
                          - title
                          - status
                          - queue_wait_count
                          - progress_percent
                          - created_at
                          - finished_at
                          - ppt_url
                          - template_id
                          - preview_img_list
                          - error
                        x-apifox-orders:
                          - id
                          - title
                          - status
                          - queue_wait_count
                          - progress_percent
                          - created_at
                          - finished_at
                          - ppt_url
                          - template_id
                          - preview_img_list
                          - error
                    required:
                      - job
                    description: 数据区
                    x-apifox-orders:
                      - job
                required:
                  - code
                  - info
                  - request_id
                x-apifox-orders:
                  - code
                  - info
                  - request_id
                  - data
          headers: {}
          x-apifox-name: 成功
      security:
        - bearer: []
      x-apifox-folder: 模板相关
      x-apifox-status: released
      x-run-in-apifox: https://app.apifox.com/web/project/3930068/apis/api-340673043-run
components:
  schemas: {}
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
servers:
  - url: https://api.mindshow.vip
    description: 正式环境
security:
  - bearer: []

```
