Create a new document

Purpose: Use this API to create a new document. You must specify values such as Category, Document Type, Name, and Size of the document in the Body Parameters. Refer to the Body Parameters section for more info.

If you are creating a document for a dispatch, you must upload the same document for your drivers to access. Take the following steps to upload the created document:

  1. Use this API and ensure to pass the following body parameters:
    1. Category: Mention the category as 'dispatch'.
    2. Dispatch ID: Mention the corresponding dispatch ID.
      {
           "doc_name": "bill of lading",
           "doc_date": "2022-06-08",
           "category": "dispatch",
           "doc_type": "pdf",
           "doc_size": 5,
           "driver_id": 123,
           "dispatch_id": 40,
           "doc_time": "2022-06-08T21:54:56.601Z"
      }
      
  2. Make the API call.
    You will receive a response.
  3. Copy the upload_url, and open the same in a browser.
  4. Upload the document.
  5. Now use the Update a specific document endpoint and add the following details:
    1. ID (Path Parameter): Mention the ID of the document that you've just uploaded.
    2. Status (Body Parameter): Mention the upload_status, as completed.

      {
        "id":15310,
        "upload_status":"completed"
      }
      
      You have now successfully created a document for the dispatch as well as uploaded the same.

Response Parameters

document

  • Type: Object
  • Description: Details of the uploaded document.

id

  • Type: Integer
  • Description: The unique identifier for the document.

category

  • Type: String
  • Description: The category of the document, e.g., "other".

upload_url

  • Type: String
  • Description: The URL where the document is to be uploaded.

ref_no

  • Type: String
  • Description: The reference number associated with the document.

notes

  • Type: String
  • Description: Notes associated with the document.

doc_date

  • Type: Date (YYYY-MM-DD)
  • Description: The date the document was created.

doc_fields

  • Type: Array of Objects (nullable)
  • Description: Custom fields associated with the document.

doc_time

  • Type: DateTime (ISO 8601)
  • Description: The time the document was created.

Language
Credentials
Header
Click Try It! to start a request and see the response here!