Zoho Upload API

The Upload API from Zoho — 2 operation(s) for upload.

Documentation

Specifications

Code Examples

Other Resources

OpenAPI Specification

zoho-upload-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Helpcenter Upload API
  version: 1.0.0
tags:
- name: Upload
paths:
  /api/v1/uploads:
    post:
      tags:
      - Upload
      summary: ' Upload file'
      description: This API uploads a file.
      operationId: uploadFile
      parameters:
      - $ref: ./Common.json#/components/parameters/orgId
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
              required:
              - file
      responses:
        '422':
          $ref: ./Common.json#/components/responses/invalidDataErrorResponse
        '200':
          $ref: '#/components/responses/uploadFileResponse'
      security:
      - iam-oauth2-schema:
        - Desk.basic.CREATE
      x-audience:
      - external-public
  /upload:
    post:
      summary: Upload a file to CRM
      description: Allows uploading a file to the CRM system using multipart/form-data.
      operationId: uploadFile
      parameters:
      - $ref: '#/components/parameters/CRMOrgHeader'
      - $ref: '#/components/parameters/Feature'
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              description: Schema for the multipart/form-data request body containing the file to upload.
              properties:
                file:
                  type: object
                  description: The file to be uploaded.
                  additionalProperties: true
              required:
              - file
              additionalProperties: false
        required: true
      responses:
        '200':
          description: File uploaded successfully.
          content:
            application/json:
              schema:
                type: object
                description: Response schema for a successful file upload.
                properties:
                  status:
                    type: string
                    enum:
                    - success
                    description: Indicates the status of the upload operation.
                  code:
                    type: string
                    enum:
                    - FILE_UPLOAD_SUCCESS
                    description: A code representing the result of the upload operation.
                  message:
                    type: string
                    enum:
                    - file uploaded.
                    description: A message describing the result of the upload operation.
                  details:
                    type: object
                    description: Details about the uploaded file.
                    properties:
                      file_id:
                        type: string
                        description: The unique identifier for the uploaded file.
                        maxLength: 255
                      created_time:
                        type: string
                        format: date-time
                        description: The time when the file was created.
                    required:
                    - file_id
                    - created_time
                    additionalProperties: false
                required:
                - status
                - code
                - message
                - details
                additionalProperties: false
        '400':
          description: Bad Request. The request was invalid or cannot be otherwise served.
          content:
            application/json:
              schema:
                type: object
                description: Response schema for a failed file upload due to invalid data.
                properties:
                  status:
                    type: string
                    enum:
                    - error
                    description: Indicates the status of the upload operation.
                  code:
                    type: string
                    enum:
                    - INVALID_DATA
                    - NOT_SUPPORTED_FEATURE
                    - MANDATORY_NOT_FOUND
                    - INVALID_FILE_FORMAT
                    description: A code representing the error encountered during the upload operation.
                  message:
                    type: string
                    description: A message describing the error.
                    maxLength: 255
                  details:
                    type: object
                    description: Optional additional data that explains the failure in more detail.
                    additionalProperties: true
                required:
                - status
                - code
                - message
                additionalProperties: false
      security:
      - iam-oauth2-schema:
        - ZohoFiles.files.ALL
      tags:
      - Upload
components:
  responses:
    uploadFileResponse:
      description: uploadFileResponse template definitions
      content:
        application/json:
          schema:
            oneOf:
            - type:
              - 'null'
              - object
              additionalProperties: false
              properties:
                previewurl:
                  type:
                  - string
                  - 'null'
                  maxLength: 16000000
                  minLength: 0
                  pattern: (^(ht|f)tp(s?)\://[-.\w]*(/?)([a-zA-Z0-9\-\.\?\,\:\'/\\+=&%\$#_@]*)?$)
                size:
                  type:
                  - string
                  - 'null'
                  - integer
                  format: int64
                  pattern: ([0-9]+)
                creatorId:
                  type:
                  - string
                  - 'null'
                  - integer
                  format: int64
                  pattern: ([0-9]+)
                name:
                  type:
                  - string
                  - 'null'
                  maxLength: 100
                  minLength: 0
                createdTime:
                  type:
                  - string
                  - 'null'
                  maxLength: 100
                  minLength: 0
                  pattern: (((19|20)\d\d)[-/.]{1}(0?[1-9]|1[012])[-/.]{1}(0?[1-9]|[12][0-9]|3[01])(T)([01]?[0-9]|2[0-3]):[0-5]?[0-9]:[0-5]?[0-9]([/.][\d]{0,3})?(Z))
                id:
                  type:
                  - string
                  - 'null'
                  - integer
                  format: int64
                  pattern: ([0-9]+)
                href:
                  type:
                  - string
                  - 'null'
                  maxLength: 500
                  minLength: 0
                  pattern: (^(ht|f)tp(s?)\://[-.\w]*(/?)([a-zA-Z0-9\-\.\?\,\:\'/\\+=&%\$#_@]*)?$)
              required:
              - createdTime
              - creatorId
              - href
              - id
              - name
              - previewurl
              - size
            - type:
              - 'null'
              - object
              additionalProperties: false
              properties:
                fileName:
                  type:
                  - string
                  - 'null'
                  maxLength: 100
                  minLength: 0
                size:
                  type:
                  - string
                  - 'null'
                  - integer
                  format: int64
                  pattern: ([0-9]+)
                createdTime:
                  type:
                  - string
                  - 'null'
                  maxLength: 100
                  minLength: 0
                  pattern: (((19|20)\d\d)[-/.]{1}(0?[1-9]|1[012])[-/.]{1}(0?[1-9]|[12][0-9]|3[01])(T)([01]?[0-9]|2[0-3]):[0-5]?[0-9]:[0-5]?[0-9]([/.][\d]{0,3})?(Z))
                id:
                  type:
                  - string
                  - 'null'
                  - integer
                  format: int64
                  pattern: ([0-9]+)
                storeId:
                  type:
                  - string
                  - 'null'
                  maxLength: 255
                  minLength: 0
                ownerId:
                  type:
                  - string
                  - 'null'
                  - integer
                  format: int64
                  pattern: ([0-9]+)
              required:
              - createdTime
              - fileName
              - id
              - ownerId
              - size
              - storeId
          examples:
            Valid responses Definitions:
              value:
                size: '4769'
                creatorId: '4000000008692'
                name: zoho.jpeg
                createdTime: 1466667102000
                isPublic: false
                id: '4000000055001'
                href: https://desk.zoho.com/api/v1/uploads/1892000001008043/contents
  parameters:
    CRMOrgHeader:
      name: X-CRM-ORG
      in: header
      description: The organization ID for the CRM instance.
      required: true
      schema:
        type: string
        maxLength: 255
    Feature:
      name: feature
      in: header
      description: The feature for which the file upload is being performed. Must be set to 'bulk-write'.
      required: true
      schema:
        type: string
        enum:
        - bulk-write
  securitySchemes:
    iam-oauth2-schema:
      $ref: ./Common.json#/components/securitySchemes/iam-oauth2-schema
x-entity: Helpcenter