Sign Up and Get Started Today

Introduction

The Tactile API allows you to access and modify data from your Tactile account programatically, using HTTP and JSON.

To make use of the API, an admin for your account must enable API access from the Admin area:

  1. Click 'Admin' at the top-right
  2. Click 'Toggle API Access', under 'External Applications'
  3. Click the 'Enable API' button

Clicking the button a second time will disable API access for the account.

Service URL

The Tactile API is accessed using the same URLs as via regular use in a web-browser, so for example at:

https://sample.tactilecrm.com

We reccomend you always use HTTPS when communicating via the API.

Authentication

Requests to make use of the API must be accompanied by an api_token parameter. For example, using curl:

curl https://sample.tactilecrm.com/?api_token=your_token_here

API tokens are issued on a per-user basis, and are generated by visiting your User Preferences page. Authentication with an API token will give your requests the same permissions as the User it is generated against.

Data Formats

When you want to fetch information, we make use of the 'query' part of the URL when looking for parameters, for example:

curl https://sample.tactilecrm.com/organisations?api_token=your_token_here&updated_after=2009-01-01

Data we return will be formatted as JSON (the spec looks a little intimidating, but it's really quite simple). Responses will have, as their first key, a "status" which will either be "success" or "error". Successful requests will then contain further keys as documented in the appropriate sections to the left.

{
  "status": "success",
  "organisations": [
    {
      "id": 1234,
      "name": "Sample Data"
    },
    {
      "id": 5678,
      "name": "Another Sample"
    }
  ]
}

(This is a sample showing the format - see the organisations section of the documentation for full details on what is returned.)

Requests that return "error" will be accompanied by an array of error messages, indicating what went wrong.

{
  "status": "error",
  "errors": ["Invalid ID Specified"]
}

(Note that even in the case of one error message, it is still in an array.)

When sending us data (to update or create something), it should be formatted as JSON and be placed in the body of a POST request (as "raw" POST data, no parameters are required).

{
  "id": 1234,
  "name": "Sample Data"
}

A few things to note:

  • String data should always be enclosed with double-quotes
  • We will always return numeric values as a number (i.e. without quotes, with decimal parts where it makes sense to)
  • Dates will be returned as "YYYY-MM-DD", timestamps will be returned ISO 8601-formatted (e.g. it is now 2014-08-01T08:47:20+01:00), but we will accept the same or anything else parseable by PHP's strtotime function
  • If a timezone isn't specified, it will default to that of our server (not your user-preference) which will switch between GMT and GMT+1 as daylight-savings dictates. We reccomend therefore, that you use an unambiguous format when suppying us with times
  • Empty values will be returned as null