> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pmock.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Initialize upload task

> initialize upload task



## OpenAPI

````yaml post /open/api/phone/minio/init/task
openapi: 3.1.0
info:
  title: apidoc
  description: ''
  version: 1.0.0
servers:
  - url: https://user.pmock.com/api
    description: Generated server url
security: []
tags: []
paths:
  /open/api/phone/minio/init/task:
    post:
      tags: []
      summary: Initialize upload task
      description: initialize upload task
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UploadTaskInitReqVO'
              description: ''
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RUploadTaskInfoVO'
          headers: {}
      deprecated: false
      security: []
components:
  schemas:
    UploadTaskInitReqVO:
      type: object
      properties:
        identifier:
          type: string
          description: File unique identifier (MD5)
        totalSize:
          type: integer
          description: >-
            File size,The total file size is supported, with a maximum of 5GB
            for file upload
          minimum: 1
        chunkSize:
          type: integer
          description: >-
            Chunk size,Calculate the number of Chunks uploaded based on
            totalSize and chunkSize(min 30MB, max 300MB)
        fileName:
          type: string
          description: File name,The file name of the uploaded file (max 60 characters)
          maxLength: 60
        uploadType:
          type: integer
          description: >-
            Upload type: 1=Ordinary file upload,2=APP upload, 3=Advanced file
            import
        phoneId:
          type: integer
          description: Phone ID,obtain through `Get phone list` api
          format: int64
      required:
        - identifier
        - totalSize
        - chunkSize
        - fileName
        - uploadType
        - phoneId
    RUploadTaskInfoVO:
      type: object
      properties:
        traceId:
          type: string
          description: Request link ID
        code:
          type: integer
          description: code
        msg:
          type: string
          description: Request return message
        data:
          $ref: '#/components/schemas/UploadTaskInfoVO'
          description: Request return data
        status:
          type: string
          description: >-
            Status, representing whether this is an instant completion or
            waiting state, finish or pending
          default: finish
      required:
        - traceId
        - code
        - msg
        - status
    UploadTaskInfoVO:
      type: object
      properties:
        finished:
          type: boolean
          description: Whether the upload is complete (whether the chunks have been merged)
        uploadType:
          type: string
          description: 上传存储的类型,minio/obs
        taskRecord:
          $ref: '#/components/schemas/UploadTaskVO'
          description: Upload task record information
    UploadTaskVO:
      type: object
      properties:
        teamId:
          type: integer
          description: Team ID
          format: int64
        uploadId:
          type: string
          description: UploadId for shard upload
        fileIdentifier:
          type: string
          description: Unique file identifier (md5)
        fileName:
          type: string
          description: File Name
        bucketName:
          type: string
          description: Belonging bucket name
        objectKey:
          type: string
          description: Key of the file
        totalSize:
          type: integer
          description: file size（byte）
        chunkSize:
          type: integer
          description: Each shard size（byte）
        chunkNum:
          type: integer
          description: Number of shards
        expireTime:
          type: string
          description: expiration time
        uploadInfo:
          type: array
          items:
            $ref: '#/components/schemas/PartUploadUrl'
            description: com.wuyin.chameleon.common.model.res.PartUploadUrl
          description: 分片上传信息
        exitPartList:
          type: array
          items:
            $ref: '#/components/schemas/PartSummary'
            description: com.wuyin.chameleon.common.model.res.PartSummary
          description: Completed uploaded shards
    PartUploadUrl:
      type: object
      properties:
        partNumber:
          type: integer
          description: 分片编号
        uploadUrl:
          type: string
          description: 上传地址
    PartSummary:
      type: object
      properties:
        partNumber:
          type: integer
          description: partNumber
        lastModified:
          type: string
          description: lastModified
        eTag:
          type: string
          description: eTag
        size:
          type: integer
          description: size
          format: int64

````