V0.2 - BETA

Last updated: January 21st, 2019

GET /actions

Returns an array of all active actions that the current user may complete.
Actions serve as templates and are used as a starting point for generating a record.
An example record action might be "Trailer Sanitation".
Return
[
	{
		"id":"123",
		"name":"Action Name",
		"frequency_description":"Every now and then",
		"load_type": "frozen",
		"description":"Action HTML description",
		"doc_code":[{\"type\":\"Title\",\"parent\":\"\",\"name\":\"\",\"text\":\"Building Exterior Inspection\",\"car_trigger\":\"\"}]
		"category":"sanitation",
		"tooltip":"Tooltip HTML template"
	}
]
Fields
  • id
    Unique action identifier
  • name
    Unique action identifier
  • frequency_description
    A description of when the activity should be completed. Ex: This activity should be completed daily
  • load_type
    The load type indicates if an activity should be associated with a specific type of load. Ex: frozen
    Load Types
  • description
    An HTML description of the activity
  • doc_code
    A JSON string used to generate a checklist
    Tooltips
  • category
    Identifies the category of the action
    Categories
  • tooltip
    An HTML string with placeholders to be used as a tooltip, preview, or short description of the activity
    Tooltips


Paramters
  • modified_datetime
    Limits the results to actions that have changed since the provide datetime Ex: /actions?modified_datetime=2000-01-01 16:12:12
  • columns
    Limits the columns results data to the fields provide. Ex: /actions?columns=id,name

GET /actions/[id]

Returns an object action that the current user may complete.
Actions serve as a template and are used as a starting point for generating a record.
An example record action might be "Trailer Sanitation".
Return
{
	"id":"123",
	"name":"Action Name",
	"frequency_description":"Every now and then",
	"load_type": "frozen",
	"description":"Action HTML description",
	"doc_code":[{\"type\":\"Title\",\"parent\":\"\",\"name\":\"\",\"text\":\"Building Exterior Inspection\",\"car_trigger\":\"\"}]
	"category":"sanitation",
	"tooltip":"Tooltip HTML template"
}
Fields
  • id
    Unique action identifier
  • name
    Unique action identifier
  • frequency_description
    A description of when the activity should be completed. Ex: This activity should be completed daily
  • load_type
    The load type indicates if an activity should be associated with a specific type of load. Ex: frozen
    Load Types
  • description
    An HTML description of the activity
  • doc_code
    A JSON string used to generate a checklist
    Tooltips
  • category
    Identifies the category of the action
    Categories
  • tooltip
    An HTML string with placeholders to be used as a tooltip, preview, or short description of the activity
    Tooltips


Paramters
  • columns
    Limits the columns results data to the fields provide. Ex: /action/123?columns=id,name

GET /assets/trailers

Returns an array of all active trailers.
Return
[
	{
		"id":"123",
		"trailer_number":"65ABC"
	}
]
Fields
  • id
    Unique trailer identifier
  • trailer_number
    The trailer number


Paramters
  • modified_datetime
    Limits the results to actions that have changed since the provide datetime Ex: /assets/trailers?modified_datetime=2000-01-01 16:12:12
  • columns
    Limits the columns results data to the fields provide. Ex: /assets/trailers?columns=id,name

GET /assets/trailers/[id]

Returns an object for the selected trailer.
Return
{
	"id":"123",
	"trailer_number":"65ABC"
}
Fields
  • id
    Unique trailer identifier
  • trailer_number
    The trailer number


Paramters
  • modified_datetime
    Limits the results to actions that have changed since the provide datetime Ex: /assets/trailers/123?modified_datetime=2000-01-01 16:12:12
  • columns
    Limits the columns results data to the fields provide. Ex: /assets/trailers/123?columns=id,name

POST /assets/trailers

Accepts JSON trailer data to either update or create a trailer
Accepts
[
	{
    	"id":"0",
    	"trailer_number":"654321",
    	"ref_id": "321"
	}
]
Returns
[
	{
		"id":182,
		"ref_id":"321"
	}
]
Fields
  • id
    Unique trailer identifier
  • trailer_number
    The trailer number
  • ref_id
    If a trailer is submitted with an ID of 0, it will create a new trailer. The ref_id is used to keep track of the new trailer ID. No data is returned if the trailer ID is not 0.

GET /assets/sensors

Returns an array of all active sensors.
Return
[
	{
		"id":"123",
		"name":"65ABC"
	}
]
Fields
  • id
    Primary Key - Unique sensor identifier
  • name
    Sensor ID used by third parties


Paramters
  • columns
    Limits the columns results data to the fields provide. Ex: /assets/sensors?columns=id,name

GET /assets/sensors/[id]

Returns an object for the selected sensor.
Return
{
	"id":"123",
	"name":"65ABC"
}
Fields
  • id
    Primary Key - Unique sensor identifier
  • name
    Sensor ID used by third parties


Paramters
  • columns
    Limits the columns results data to the fields provide. Ex: /assets/sensors/123?columns=id,name

POST /assets/sensors

Accepts JSON sensor data to either update or create a sensor
Accepts
[
	{
		"id":"123",
		"name":"65ABC",
		"ref_id":"321"
	}
]
Returns
[
	{
		"id":182,
		"ref_id":"321"
	}
]
Fields
  • id
    Primary Key - Unique sensor identifier
  • name
    Sensor ID used by third parties
  • ref_id
    If a trailer is submitted with an ID of 0, it will create a new trailer. The ref_id is used to keep track of the new sensor ID. No data is returned if the sensor ID is not 0.

POST /assets/sensors/[id]/readings

Accepts JSON sensor readings data to either create or update reading
Accepts
[
	{
		"id":"123",
		"datetime":"2000-01-01 12:12:12",
		"type":"temperature",
		"data":{
			"temperature":"5",
			"scale":"F"
		}
	}
]
Fields
  • id
    Primary Key - Unique reading identifier
  • datetime
    The UTC date & time of the reading
  • type
    The type of reading. Currently supports "temperature"
  • data
    An object that contains the data for the reading.
    Temperature:
    • temperature
      The reading temperature without the scale
    • scale
      The temperature scale (F or C)

GET /loads

Returns an array of all active loads that the current user has access to.
Loads contain some load specific information and to group various activities together.
Return
[
	{
		"id":"123",
		"load_number":"65ABC",
		"trailer_number":"654321",
		"type": "frozen"
	}
]
Fields
  • id
    Unique load identifier
  • load_number
    A user provided identifier
  • trailer_number
    The trailer number for the load
  • type
    Load type identifier. Used to determine which types of records should be added to the load.
    Load Types


Paramters
  • modified_datetime
    Limits the results to actions that have changed since the provide datetime Ex: /loads?modified_datetime=2000-01-01 16:12:12
  • columns
    Limits the columns results data to the fields provide. Ex: /loads?columns=id,name

GET /loads/[id]

Returns an object load that the current user has access to.
Loads contain some load specific information and to group various activities together.
Return
{
	"id":"123",
	"load_number":"65ABC",
	"trailer_number":"654321",
	"type": "frozen"
}
Fields
  • id
    Unique load identifier
  • load_number
    A user provided identifier
  • trailer_number
    The trailer number for the load
  • type
    Load type identifier. Used to determine which types of records should be added to the load.
    Load Types


Paramters
  • modified_datetime
    Limits the results to actions that have changed since the provide datetime Ex: /loads/123?modified_datetime=2000-01-01 16:12:12
  • columns
    Limits the columns results data to the fields provide. Ex: /loads/123?columns=id,name

POST /loads

Accepts JSON load data to either update or create a load
Accepts
[
	{
    	"id":"0",
    	"load_number":"65ABC",
    	"trailer_number":"654321",
    	"type": "frozen",
    	"ref_id": "321"
	}
]
Returns
[
	{
		"id":182,
		"ref_id":"321"
	}
]
Fields
  • id
    Unique load identifier
  • load_number
    A user provided identifier
  • trailer_number
    The trailer number for the load
  • type
    Load type identifier. Used to determine which types of records should be added to the load.
    Load Types
  • ref_id
    If a load is submitted with an ID of 0, it will create a new load. The ref_id is used to keep track of the new load ID. No data is returned if the load ID is not 0.

POST /loads/[id]

Accepts JSON load data to either update or create a load
Accepts
{
	"load_number":"65ABC",
	"trailer_number":"654321",
	"type": "frozen"
}
Fields
  • id
    Unique load identifier
  • load_number
    A user provided identifier
  • trailer_number
    The trailer number for the load
  • type
    Load type identifier. Used to determine which types of records should be added to the load.
    Load Types

GET /locations

Returns an array of all active locations available to within the application.
Locations serve as a way to group records.
Return
[
	{
		"id":"123",
		"name":"New York"
	}
]
Fields
  • id
    Unique location identifier
  • name
    Location Name


Paramters
  • modified_datetime
    Limits the results to actions that have changed since the provide datetime Ex: /locations/123?modified_datetime=2000-01-01 16:12:12
  • columns
    Limits the columns results data to the fields provide. Ex: /locations/123?columns=id,name

GET /locations/[id]

Returns an array of all active locations available to within the application.
Locations serve as a way to group records.
Return
{
	"id":"123",
	"name":"New York"
}
Fields
  • id
    Unique location identifier
  • name
    Location Name


Paramters
  • columns
    Limits the columns results data to the fields provide. Ex: /locations?columns=id,name

POST /login

Accepts JSON data to create a session token. The token is used to authenticate all future requests.
Accepts
{
	"username":"Admin",
	"password":"Password"
}
Returns
{
	"user_id":"26",
	"username":"test",
	"token":"c4dd7d4cb6f2bbf28e0086aebc5b0dfa",
	"first_name":"Bill",
	"last_name":"Smith",
	"email":"bsmith@ironapple.net",
	"time_zone":"ADT"
}
Fields
  • user_id
    Unique user identifier. Used with the token for future request authentication
  • username
    The user's username
  • token
    A new token used for future request authetication
  • first_name
    The user's first name
  • last_name
    The user's last name
  • email
    The user's email address
  • time_zone
    A unique time zone identifier
    Time Zones

GET /records

GET /records returns an array of all records that the current user has access to.
An example record action might be "Trailer Sanitation".
Return
[
	{
		"id":"123",
		"action_id":"123",
		"name":"Action Name",
		"frequency_description":"Every now and then",
		"load_type": "frozen",
		"description":"Action HTML description",
		"doc_code":[{\"type\":\"Title\",\"parent\":\"\",\"name\":\"\",\"text\":\"Building Exterior Inspection\",\"car_trigger\":\"\"}],
		"doc_answers":doc_answers":"{\"building_name\":\"Name\",\"Key\":\"Value\"}",
		"category":"sanitation",
		"tooltip":"Tooltip HTML template",
		"status":"",
		"completion_name":"",
		"completion_datetime":"",
		"location_id":"",
		"load_id":""
	}
]
Fields
  • id
    Primary Key - Unique action identifier
  • action_id
    Reference ID for the action template
  • name
    Unique action identifier
  • frequency_description
    A description of when the activity should be completed. Ex: This activity should be completed daily
  • load_type
    The load type indicates if an activity should be associated with a specific type of load. Ex: frozen
    Load Types
  • description
    An HTML description of the activity
  • doc_code
    A JSON string used to generate a checklist
    Checklists
  • doc_answers
    A JSON string for an object that contains all of the answers for the record.
    Checklists
  • category
    Identifies the category of the action
    Categories
  • tooltip
    A HTML string with placeholders to be used as a tooltip, preview, or short description of the activity
    Tooltips
  • status
    The completion status of the record.
  • completion_name
    The name of who completed the activity as provided by the user.
  • completion_datetime
    The UTC completion date & time provided the user.
  • location_id
    Foreign Key - Unique location identifier
  • load_id
    Foreign Key - Unique load identifier


Paramters
  • modified_datetime
    Limits the results to actions that have changed since the provide datetime Ex: /records?modified_datetime=2000-01-01 16:12:12
  • columns
    Limits the columns results data to the fields provide. Ex: /records?columns=id,name

GET /records/[id]

Returns an object record that the current user has access to.
An example record action might be "Trailer Sanitation".
Return
{
	"id":"123",
	"action_id":"123",
	"name":"Action Name",
	"frequency_description":"Every now and then",
	"load_type": "frozen",
	"description":"Action HTML description",
	"doc_code":[{\"type\":\"Title\",\"parent\":\"\",\"name\":\"\",\"text\":\"Building Exterior Inspection\",\"car_trigger\":\"\"}],
	"doc_answers":doc_answers":"{\"building_name\":\"Name\",\"Key\":\"Value\"}",
	"category":"sanitation",
	"tooltip":"Tooltip HTML template",
	"status":"",
	"completion_name":"",
	"completion_datetime":"",
	"location_id":"",
	"load_id":""
}
Fields
  • id
    Primary Key - Unique action identifier
  • action_id
    Reference ID for the action template
  • name
    Unique action identifier
  • frequency_description
    A description of when the activity should be completed. Ex: This activity should be completed daily
  • load_type
    The load type indicates if an activity should be associated with a specific type of load. Ex: frozen
    Load Types
  • description
    An HTML description of the activity
  • doc_code
    A JSON string used to generate a checklist
    Checklists
  • doc_answers
    A JSON string for an object that contains all of the answers for the record.
    Checklists
  • category
    Identifies the category of the action
    Categories
  • tooltip
    A HTML string with placeholders to be used as a tooltip, preview, or short description of the activity
    Tooltips
  • status
    The completion status of the record.
  • completion_name
    The name of who completed the activity as provided by the user.
  • completion_datetime
    The UTC completion date & time provided the user.
  • location_id
    Foreign Key - Unique location identifier
  • load_id
    Foreign Key - Unique load identifier


Paramters
  • modified_datetime
    Limits the results to actions that have changed since the provide datetime Ex: /records/123?modified_datetime=2000-01-01 16:12:12
  • columns
    Limits the columns results data to the fields provide. Ex: /records/123?columns=id,name

POST /records

Accepts JSON load data to either update or create a record
Accepts
[
	{
		"id":"123",
		"action_id":"123",
		"name":"Action Name",
		"frequency_description":"Every now and then",
		"load_type": "frozen",
		"description":"Action HTML description",
		"doc_code":[{\"type\":\"Title\",\"parent\":\"\",\"name\":\"\",\"text\":\"Building Exterior Inspection\",\"car_trigger\":\"\"}],
		"doc_answers":doc_answers":"{\"building_name\":\"Name\",\"Key\":\"Value\"}",
		"category":"sanitation",
		"tooltip":"Tooltip HTML template",
		"status":"",
		"completion_name":"",
		"completion_datetime":"",
		"location_id":"",
		"load_id":""
	}
]
Returns
[
	{
		"id":182,
		"ref_id":"321"
	}
]
Fields
  • id
    Primary Key - Unique action identifier
  • action_id
    Reference ID for the action template
  • name
    Unique action identifier
  • frequency_description
    A description of when the activity should be completed. Ex: This activity should be completed daily
  • load_type
    The load type indicates if an activity should be associated with a specific type of load. Ex: frozen
    Load Types
  • description
    An HTML description of the activity
  • doc_code
    A JSON string used to generate a checklist
    Checklists
  • doc_answers
    A JSON string for an object that contains all of the answers for the record.
    Checklists
  • category
    Identifies the category of the action
    Categories
  • tooltip
    A HTML string with placeholders to be used as a tooltip, preview, or short description of the activity
    Tooltips
  • status
    The completion status of the record.
  • completion_name
    The name of who completed the activity as provided by the user.
  • completion_datetime
    The UTC completion date & time provided the user.
  • location_id
    Foreign Key - Unique location identifier
  • load_id
    Foreign Key - Unique load identifier

Authentication

Request authentication uses basic HTTP authentication using the user_id and token returned by the /login request.

Categories

Used to group similar activities and records together
Categories
  • haccp
  • maintenance
  • pest_control
  • policies
  • purchasing
  • recall
  • sanitation
  • training
  • water_quality
  • warehouse
  • storage

Checklists

Checklists are saved in two parts (Form & Answers). The visual aspect of the element is not defined and is up to you to implement. Feel free to match our existing layouts.
Form
[
	{
    	"type":"Title",
    	"name":"myName",
    	"text":"This is a title!",
    	"car_trigger": ""
	}
]
Fields
  • type
    Defines the type of the checklist element
  • name
    An alphanumeric identifier for the checklist element
  • text
    The text portion of the element visible to the user. Plain text only.
  • car_trigger
    If the users answer to the element matches the car_trigger, a corrective action is triggered. Typically used with radio button.
Checklist Elements
  • Paragraph
    Plain text paragraph suitable for long instructions.
  • Title
    Short section description.
  • ChecklistTitle
    Similar to Title, except it is used prior to a checklist.
  • ChecklistRadio
    Provides a Yes/No option to the user
  • Textbox
    Provides a textbox to the user for data entry.
  • Date
    Similar to Textbox, except it must be in a standard date format.
  • DateTime
    Similar to Textbox, except it must be in a standard datetime format.
  • Textarea
    Similar to a Textbox, except it has additional space. Used for longer descriptive answers.
  • Temperature
    A multi part element which requires the user to enter a temperature and select the appropriate scale (farenheit or celcius)
Answers
{
	"myName":"Answer",
	"OtherQuestion":"Answer #2"
}
Fields
  • Key
    The name from the form element serves as the key.
  • Value
    The user's answer is saved as the value
Checklist Elements
  • Paragraph
    No answer possible
  • Title
    No answer possible
  • ChecklistTitle
    No answer possible
  • ChecklistRadio
    No answer possible
  • Textbox
    Plain text, no maximum length
  • Date
    Plain text, must me in standard date format.
  • DateTime
    Plain text, must me in standard datetime format.
  • Textarea
    Plain text, no maximum length
  • Temperature
    The value is a numeric value provided by the user.
    You must also provide the scale (Scale key is [ELEMENT_NAME]_scale. Possible values are F and C
    Temperature_c and temperature_f are automatically created based on the provided values.
Temperature Answer Example
{
	"temperature":"5",
	"temperature_scale":"F",
	"temperature_f":"5",
	"temperature_c":"-15"
}

Date & Time Formats

All dates and times are stored in a standard format. They are all stored in UTC.
Formats
  • Dates
    Year-Month-Day: 2000-01-01
  • Times
    Hour-Minutes-Seconds: 16:12:00
  • Date & Time
    Year-Month-Day Hour-Minutes-Seconds: 2000-01-01 16:12:00

Load Types

Used with loads, actions, and records to identify a load type. The
Types
  • frozen
  • refrigeration
  • non_refrigerated
  • all
    Special load type used for actions and records only. Records and actions with this load type can be used with any type of load.

Time Zones

List of supported time zones.
Time Zones
  • NDT - Newfoundland Daylight Time
  • AST - Atlantic Standard Time
  • ADT - Atlantic Daylight Time
  • EST - Eastern Standard Time
  • EDT - Eastern Daylight Time
  • CST - Central Standard Time
  • CDT - Central Daylight Time
  • MST - Mountain Standard Time
  • MDT - Mountain Daylight Time
  • PDT - Pacific Daylight Time
  • AKDT - Alaska Daylight Time
  • HST - Hawaii Standard Time
  • UTC - Coordinated Universal Time

Tooltips

Tooltips are used to give short descriptions of activites which contain activitiy content. For example, a Trailer Sanitation record might have a tooltip of "Trailer: [[trailer_number]]" which would be displayed as "Trailer: 12345" after replacing the placeholder with the trailer number. Placeholders pull their information from the record answers with a few exceptions.
Exceptions
  • load_number
    Fetched from the assocaited load instead of the record answers.
  • trailer_number
    Fetched from the assocaited load instead of the record answers.
  • location_id
    Fetched from the assocaited location instead of the record answers.