Skip to main content

Documents

For details on how to use the documents API, visit the Integrating With Documents guide.

The Documents REST API is an alternative to the GraphQL API, that has been designed to make it easy to implement your organisation's documents into Mobiledock.

About Documents

In Mobiledock, documents are a way of allowing the creation of bookings to your site with a given identifier. Most commonly, this is used to create bookings against a valid Purchase Order (PO), Advance Shipment Notice (ASN), but can be used for any number of cases.

When a booking is being made at your site, the individual making the booking has the option to pass through a document id instead of manually entering all of the relevant information about a given task. Mobiledock will look up the document from the id provided, check that is has permission to be used and will pre-fill all of the information about the task.

Which API Should I Use?

For most integrations, the REST API is typically the easiest way to get up and running with Mobiledock Documents. It provides a couple of benefits over the GraphQL:

  • The interface may be more familiar for some developers
  • Organisations, loads and booking options can each be referenced by identifiers other than id, such as name, or, in the case of organisations, custom attributes

If referencing document entities by id isn't an issue for your integration and you're familiar with GraphQL syntax, then GraphQL may be the better choice as it allows you to query additional data and perform other mutations as side effects of your documents' changes.

Usage

Query All Documents

GET /organisations/{organisationId}/documents

Retrieve a list of documents.

Parameters

NameDescription
pageNumber
Int
The page number to be returned. Page numbers begin at index 1. Defaults to 1.
pageSize
Int
The number of documents to be returned per page. Cannot exceed 1000. Defaults to 100.

Return: DocumentQuery!

Query a Single Document

GET /organisations/{organisationId}/documents/{documentId}

Retrieve a single document by id.

Return: Document!

Create a New Document

POST /organisations/{organisationId}/documents

Create a new document.

Body: DocumentInput!

Return: Document!

Update an Existing Document

PUT /organisations/{organisationId}/documents/{documentId}

Update an existing document by id.

Body: DocumentInput!

Return: Void

Upsert a Document

PUT /organisations/{organisationId}/documents/{documentId}?upsert=true

Either updates an existing document by id, or creates the document if it does not exist.

Body: DocumentInput!

Return: Void

Delete a Document

DELETE /organisations/{organisationId}/documents/{documentId}

Delete a document by id.

Return: Void