Authorization

The Legacy REST API uses Basic Authentication.

User setup

A user for REST API access must be set up in the TMS Control Panel:

  1. Go to the TMS Control Panel page
  2. Click "Users"
  3. On the upper tab, click "WEB Users"
  4. Click "Add WEB User"
  5. Under "Product", select "REST API" and enter the other details, most importantly email and password.

Headers

Given the email and password from the previous step, the Authorization header can be prepared:

  1. Base64 encode the string <email>:<password>
  2. Set the Authorization header to Basic + the encoded string from step 1

Most tools and frameworks will support Basic auth and prepare the correct headers given the email and password, for example:

Using Curl:

curl -u <email>:<password>

Using Python:

import requests

response = requests.get(
    "https://myinstance.administrateapp.com/api/v2/crm/contacts", 
    auth=('<email>', '<password>')
)

Using PHP:

$url = 'https://myinstance.administrateapp.com/api/v2/crm/contacts';
$options = array(
  'http' => array(
    'method'  =>  'GET',
    'header'  =>  "Accept: application/json\r\n" .
                  "Authorization: Basic " . base64_encode($credentials)
    )
);
$context  = stream_context_create($options);
$result = file_get_contents($url, false, $context);