« Return to Index


API Actions

  • Search - fetch a list of database records matching specified parameters.
  • Fetch - fetch a single database record, by providing it's ID.
  • Update - modify the values in a single database record
  • Add - insert a new database record
  • Delete - mark a databsae record as no-longer used
  • Upload Document - upload the contents of a document record (eg: photo or pdf).
  • Mark Completed - mark an inspection as completed, recording the date and optionally providing an inspector's signature
  • Generate Report - create an inspection report
Name search
Required Parameters entity (string)
Optional Parameters modified_since (datetime)
terms (object)
Result array

Returns a list of databsae rows in a single entity, matching any search terms you provide.

The entity parameter is required, see the entities list.

Using the modified_since property, you can search for all database records that were modified or created since the specified moment in time. Typically this timestamp would be the date/time of a previous API request (all API responses contain the server's current time, see the Protocol Reference).

The search_terms property is an object containing database column names and values to search for. Only records matching the specified values will be returned. You can prefix and/or suffix the value with a % character to perform wildcard matching. Searches are case insensitive.

If you provide a modified_since date, then any database record that was deleted after that date will also be returned, allowing you to delete any copy you have of the recently deteleted record. Use the deleted boolean of the entity to check for this. If no modified_since date is provided, then deleted records are never returned.

Fetch

Name fetch
Required Parameters entity (string)
id (integer)
Optional Parameters reference (string)
Result object

Specify an entity and id to fetch a single database record.

With some entities, you can specify the reference instead of id. If both are specified, reference will override the id.

Update

Name update
Required Parameters entity (string)
id (integer)
values (object)
Optional Parameters none
Result object

Specify an entity and id and new values to be applied to a single database record.

You do not need to provide values for every column in the entity. Any missing columns will be left untouched.

Not all entities can be updated. See the "Access Level" on the reference page for each entity. Some entity values are also Read Only. An exception will be thrown if you attempt to update a Read Only entity or value.

Returns a copy of the entire record, after applying the update.

Add

Name add
Required Parameters entity (string)
values (object)
Optional Parameters none
Result object

Insert a new record into the database, with a list of values to apply.

You do not need to provide values for every column in the entity. Default values will be used for any missing columns.

The entire record is returned, including the ID of the new record.

Not all entities can be inserted via the API. See the "Access Level" on the reference page for each entity. Some entity values are also Read Only. An exception will be thrown if you attempt to add to a Read Only entity.

Delete

Name delete
Required Parameters entity (string)
id (integer)
Optional Parameters none
Result none

Mark a single record as being deleted.

Not all entities can be deleted. See the "Access Level" on the reference page for each entity. An exception will be thrown if you attempt to delete a Read Only entity.

Upload Document

Name upload-document
Required Parameters id (integer)
filename (string)
size (integer)
data (binary)
Optional Parameters none
Result string|false

Upload the contents of a document record, typically a photo or pdf file. You must specify the id of the document (which must already have been created in a previous API request) and the size of the data (the number of bytes before the data is encoded with Base 64).

If the data was successfully written to disk and matches the number of bytes specified in the size parameter, then this will return the URL to the document (which will include the specified filename combined with a random string to keep the data private).

If the data was not fully recieved, it will return false and you shuold attempt the upload again later.

Mark Completed

Name mark-completed
Required Parameters id (integer)
date (datetime)
Optional Parameters signature-size (integer)
signature-data (binary)
Result bool

Mark an inspection as having been completed at a specified date/time, optionally providing a signature JPEG image.

If signature data is provided, then you must also provide the size of the data in bytes.

Generate Report

Name generate-report
Required Parameters id (integer)
Result object

Generate a report for a given inspection. Returns the document for the report, which includes a URL to the pdf file.

For some reports (especially with a lot of photos), this can take several minutes to run.


Inspection Apps API Documentation « Return to Index