What is REST?
REST - Representational State Transfer is an architectural pattern that describes how distributed systems can expose a consistent interface. Basically it means, "do nothing until asked, and don't worry about the API being at rest in between."
REST APIs are accessed via HTTPS protocol, via a predefined set of URLs known as "endpoints".
/employees
Endpoints can have actions for business processes and workflows:
/employees/id/actions/force-password-change
API endpoints receive calls to provide, exchange, or capture information via methods like:
GET - Get information from the system.
POST - Send information to the system, usually to create new records or trigger a business process or workflow.
PATCH - Send information to the system, usually to update existing records.
All call methods usually result in a RESPONSE being sent back to you, to communicate outcomes.
JSON Data Format
The TrackTik API expects to work with JavaScript Object Notation formatted information. It's a hierarchical (nestable) key:value format.
[GET] /employees/322
{
"id" : 322,
"name" : "My Name",
"email" : "myemail@domain.ca",
"startDate" : "2010-01-01"
}
Anatomy of an API Call
"I want to see the data in an employee record whose unique identifier is 322.”
Tools of the Trade
You can access the TrackTik API from your favourite programming language, Electronic Data Exchange software (like Postman), JavaScript, and even a VBA macro in Excel.
E.g.
PHP Curl - Authentication
<?php
$portal = 'https://<domain>/rest/oauth2/access_token';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $portal);
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, array(
'client_id' => "d6543c...",
'client_secret' => "bdc6ed2e...",
'username' => "developer@domain.com",
'password' => "secret",
'grant_type' => 'password'
));
$data = curl_exec($ch);
$auth_string = json_decode($data, true);
print_r($auth_string);
?>
Postman - Report Templates Lookup