swagger: '2.0'
info:
  x-ibm-name: ndis-upload-file
  title: NDIS Upload File
  version: 3.0.0
  description: Digital Partners can use the Upload Files API to share a supporting document with NDIA
  contact:
    name: NDIA Support Team
    email: api.support@ndis.gov.au
schemes:
  - https
host: api.ndis.gov.au
basePath: /sharedservices/ndis-api/ndis/3.0/upload-file
consumes:
  - text/csv
  - application/pdf
  - image/jpeg
  - image/jpg
  - application/vnd.ms-excel
  - application/msword
  - application/vnd.openxmlformats-officedocument.wordprocessingml.document
  - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
  - application/octet-stream
  - image/png
produces:
  - text/csv
  - application/pdf
  - image/jpeg
  - image/jpg
  - application/vnd.ms-excel
  - application/msword
  - application/vnd.openxmlformats-officedocument.wordprocessingml.document
  - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
  - application/octet-stream
  - image/png
security:
  - clientIdHeader: []
securityDefinitions:
  clientIdHeader:
    type: apiKey
    in: header
    name: X-IBM-Client-Id
    description: 'apiKey provided during registration. Max Length(64). example: aa111aa-11a1-1a11-111a-1a1a11aa111a'
x-ibm-configuration:
  testable: true
  enforced: true
  cors:
    enabled: true
  phase: realized
  type: rest
  servers:
    - url: https://api.ndis.gov.au/sharedservices/ndis-api/ndis/3.0/upload-file
      description: ''
      type:
        - production
        - development
    - url: https://api.ndis.gov.au/sharedservices/ndis-api/ndis/3.0/upload-file
      description: ''
      type:
        - production
        - development
paths:
  /:
    post:
      responses:
        '200':
          description: 'Success: The request was successful'
          schema:
            $ref: '#/definitions/post_document_response'
        '400':
          description: 'Bad Request: A validation resulted in the request being rejected.'
          schema:
            $ref: '#/definitions/http_error'
        '401':
          description: 'Unauthorised: No authentication credentials provided or authentication has failed.'
          schema:
            $ref: '#/definitions/http_error'
        '404':
          description: The URI path or the requested record was not found.
          schema:
            $ref: '#/definitions/http_error'
        '500':
          description: 'Internal Server Error: An internal error has occurred and the server is unable to respond.'
          schema:
            $ref: '#/definitions/http_error'
      tags:
        - POST
      operationId: post_documents
      summary: Create a new document
      description: Create a new document
      parameters:
        - $ref: '#/parameters/filename'
        - $ref: '#/parameters/content_type'
        - $ref: '#/parameters/description'
        - $ref: '#/parameters/note'
        - $ref: '#/parameters/quotation_id'
        - $ref: '#/parameters/process_type'
    parameters:
      - $ref: '#/parameters/authorization'
parameters:
  authorization:
    name: authorization
    type: string
    required: true
    in: header
    description: Bearer token
    x-example: valid Authorizaton Token
  content_type:
    name: content_type
    type: string
    required: true
    in: header
    description: File type(i.e text/plain, image/jpeg). Max Length(40)
    x-example: application/json
  filename:
    name: filename
    type: string
    required: true
    in: header
    description: Document name. Max Length(40)
    x-example: filename
  description:
    name: description
    type: string
    required: false
    in: header
    description: The Uploading file description
    x-example: description
  note:
    name: note
    type: string
    required: false
    in: header
    description: The note for the Uploading file
    x-example: note
  quotation_id:
    name: quotation_id
    type: string
    maxLength: 80
    required: false
    in: header
    description: The quotation_id for which the Document should be attached
    x-example: 1011111
  process_type:
    name: process_type
    type: string
    required: false
    in: header
    description: The process_type for which the Document should be attached
    x-example: process_type
  content_length:
    name: content_length
    type: integer
    required: false
    in: header
    format: int64
    description: Size of file in bytes. Max Length(n/a)
    x-example: 1234
definitions:
  post_document_response:
    description: Response for Posting a document
    properties:
      success:
        type: boolean
        example: true
      result:
        $ref: '#/definitions/post_document_response_data'
      errors:
        $ref: '#/definitions/errors'
    additionalProperties: false
    required:
      - success
  post_document_response_data:
    description: Fields of a document used to Post it
    properties:
      document_id:
        type: string
        description: document id reference. Max Length(32)
    additionalProperties: false
  errors:
    description: A set of errors
    type: array
    items:
      type: string
      example: error
  http_error:
    description: A single HTTP response
    properties:
      http_code:
        type: string
        example: 400
        description: HTTP status code
      http_message:
        type: string
        example: Bad Request
        description: HTTP Message
      more_information:
        type: string
        example: One or more required API parameters are missing.
        description: Additional information
    additionalProperties: false
tags: []
