T Comm Public API
Welcome to our new public API. Below is an explanation on how you should authenticate your requests to the API. This authentication schema is required for all actions described in the OpenAPI spec linked below.
Welcome to our new public API. Below is an explanation on how you should authenticate your requests to the API. This authentication schema is required for all actions described in the OpenAPI spec linked below.
Consider the following example for retrieving a list of units:
GET https://api.tcommtelematics.com/v1/units?sort_field=plate&sort_type=asc
The part which has to be signed is:
units?sort_field=plate&sort_type=asc
The final request URL will become:
GET https://api.tcommtelematics.com/v1/units?sort_field=plate&sort_type=asc&key=<public_key>&hash=<signature>
Example Code
<?php
$public_key = "{PUBLIC_KEY}";
$private_key = "{PRIVATE_KEY}";
$main_link = 'https://api.tcommtelematics.com/';
$base_path = "v1/updates/latest";
$conditions = "?sort_field=id&sort_type=desc";
$hashBase = $base_path . urlencode($conditions);
$hash = hash_hmac('sha256', $hashBase, $private_key);
$api_url = "{$main_link}{$base_path}{$conditions}&hash={$hash}&key={$public_key}";
?>
It's possible to get updates from units through the endpoint:
GET https://api.tcommtelematics.com/v1/updates/unit/{unit_id}?
Nonetheless this endpoint is not meant to be used if the goal is to get the last update of each unit.
For that case, one single query can be done to:
GET https://api.tcommtelematics.com/v1/updates/latest
This will return the latest update of ALL the customer units.
In case you are an OBSERVER, you can retrieve the latest updates at:
GET https://api.tcommtelematics.com/v1/observers/updates/latest
It's possible to retrieve the static data of a unit through the following endpoint:
GET https://api.tcommtelematics.com/v1/units/{unit_id}
But if the goal is to get ALL the static data from all the units, we can achieve that with one single request:
GET https://api.tcommtelematics.com/v1/units