Preventing Road Casualties With Telematics
April 2, 2024TrackerPro Admin API: Data Concepts
September 13, 2024TrackerPro Admin API: Overview
This section provides an overview of how data flows to and from the TrackerPro Admin API. As the API is JSON based, make sure you’re familiar with http and JSON.
All calls to the TrackerPro Admin API should be made to:
https://trackerpro.payasyoutrack.com/trackerpro_Admin.ashx
Request
Calls should be made using either a http ‘GET’ or ‘POST’ request. ‘GET’ requests are permitted mainly for testing purposes. These can sometimes fail if the query string is too long so where possible in production code, make ‘POST’ requests.
Note that all API calls are logged and timed. There are limits set on call frequency to prevent over enthusiastic call rates. If you have any questions please email us and we’ll let you know what your limits are.
Before you use the TrackerPro Admin API you will need your authorisation key. This is unique to you and should not be exposed to clients. It’ll take the form XXXXADMINKEYXXXX in the examples.
Query Parameters
Requests to the TrackerPro Admin API require parameters. The query parameters should as a minimum include the authorisation key (key) and an operation (op) and sub operation (subop). Additional parameters will need to be added depending on the op/subop and there are also some optional parameters to set datetime formatting.
Parameter | Value | Required |
key | {XXXXADMINKEYXXXX} | Yes |
op | {op} | Yes |
subop | {subop} | Yes |
….. | …. | Yes – parameters required by the op/subop call. There might be 0 or N parameters depending on the op/subop |
dtm | {date time format} | No – by default format is new Date(XXXXXXX). Set to ‘o’ for ISO format. |
callback | {jsonp callback function} | No |
reqId | {a client set unique id for the call, returned in response} | No |
Response
Successful JSON responses (with HTTP Status Code 200) will take one of the following forms. The payload (the field ‘value’ or ‘dataset’ here) is not shown as this will be specific to the particular API call. Status will be set to “ok”.
Simple ‘single value’ return (type 1)
{
"version":"0.6"
,"reqId":"0"
,"status":"ok"
,"sig":"-42971447"
,"value":...
Complex ‘dataset’ return (type 2)
{
"version":"0.6"
,"reqId":"0"
,"status":"ok"
,"sig":"-42971447"
,"dataset":...
Failed JSON responses (with HTTP Status Code 200) follow a similar pattern. Status will be set to “error”. Status will not be set to anything other than “ok” or “error”.
{
"version":"0.6"
,"status":"error"
,"errors":[{"reason":"user_not_authenticated","message":"Access to the System denied"}]
}
In the above case the “errors” array will give the reason for error. Typically this is likely to be one of.
- user_not_authenticated
- access_denied
- unsupported_query_operation
- invalid_query
- invalid_request
- internal_error
- no_credit_left
The above format is based on (but does not fully follow) the Google Visualization JSON format. This is described here:
For type 2 returns the field “dataset” is returned, not a ‘table’ field as per the Google Visualization JSON format. The “dataset” field is in fact a simple object containing a JSON array of tables in Google Visualization format.
Next: Data Concepts