Crittah API V2

The Crittah Application Program Interface (API) allows your organisation to send information into Crittah from you Line of Business (LOB) system or even another cloud application. 

The Crittah API has been written to loosely conform to Representational state transfer (REST) principals. REST is considered the most comparable LOB System is written in PHP, C++, Java, C# or ObjectiveC you will be able to communicate with the Crittah API.

The Crittah API is only available in the Enterprise version of Crittah. If you would like to upgrade from Standard or Lite to use this feature please contact sales on our website (www.crittah.com)


Getting Started

Introduction

This document is a reference for the Crittah API. It includes information about:

  • Policies for using the API
  • Our coding philosophy and best practices
  • Information on how to get an AppId and authenticate to the system
  • Reference information for resources
  • References for error and warning codes
  • A glossary

Audience

This documentation was written for people who have an understanding of JSON, XML, or HTML, and have a knowledge of a programming language such as PHP or c#. Use of this documentation will also be easier for those familiar with the Crittah application from a user’s point of view.

Security

The Crittah API user does have permissions and the ability to view, create and updated customers, contacts, jobs and other information within your Crittah Instance. Please ensure that you do not inadvertently disclose the Application ID, API username or API password to any unauthorised user or publicly on the internet. Any software or system you create to interface with Crittah's API should ensure all necessary security measures are taken to protect the data contained in your Crittah Instance.

The Crittah API is designed so that you can take action to re-generate password,  Application ID's immediately to protect your information in the event that you become aware of any miss use of the Crittah API by an external application or system.

REST

Crittah API loosely conforms with the principles of REST.

Of note:

  • Resources are nouns. When you refer to a resource you refer to a thing, such as a contact, a customer, or a job.
  • Resource names are plural. To request all customers, use the URI /customers/. To request a single customer, use the URI customers/123
  • Data can be received and returned in XML and JSON formats
  • You can use GET, PUT, POST, and DELETE to work with resource data (note: not all resources support all actions)


The standard methods are:

MethodAction performed
GET Retrieves data from a resource 
DELETE Deletes the data from a resource
POST Creates a new resource or updates the supplied data for an existing resource. also used to post complex data structures for searches.
PUT Overwrites the resource with the data you provided


Tools

To test the Crittah API you can use a simple command line tool called "cURL" (As in "Call URL") or a more user friendly application called Postman.

Postman

Postman can be downloaded from https://www.getpostman.com/

cURL

 cURL can be used on Windows, Linux and UNIX machines to perform your testing with the Crittah API. Curl is usually installed on Mac, Linux and UNIX systems by default. If you are running windows then you can download and install cURL from here.

In the API documentation examples of API calls will be provided using cURL to simplify the documentation. 

Setup Crittah for API user

To setup Crittah for use of the API use you will need to register at least one API user. To do this navigate to Admin-> Administration. Click on "Crittah API Users" under the "Integration" section.

Click on the Add button. When adding a user you will need to provide a name for the application that will be accessing Crittah, a username for the API user , password and e-mail address. Crittah will generate a GUID that will also be used when connecting to Crittah.

When you connect tot eh Crittah REST API web service you will always need to provide the following information in the header of the call:-

  • API-AppID
  • API-Username
  • API-Password

There are complete example calls in the documentation of each REST web service provided. These example class will show you how to user the credentials you have setup above when access the Crittah API.

Relationship diagram

The following digram shows the relationship of entities within Crittah. Tis can be used to understand the relationship between customers, contacts, drivers, jobs, shifts etc. You can use this in conjunction with the API documentation to update and retrieve information from Crittah.


REST documentation