Skip to content

Vehicle Visibility

A common request for data integration is to provide a low overhead, bulk operation to retrieve a set of updated vehicle locations on a regular cadence.

The TN360 API's provide a specialised API that may be used for this express purpose. By default, this call includes all vehicles in scope for the API key in use.

This API takes some additional URL parameters to curate the available information:

  • embed: when set to 'vehicles', the API will include additional information about the associated vehicle, including name, registration etc.
  • gps: when set to true the API will include the vehicles last know GPS location. This is normally what you want
  • last_updated: when set to the most recent timestamp from a previous query, will restrict the API response to only include vehicles that have had a location update since the 'last_updated' date.
GET /v1/vehicles/stats?embed=vehicles&gps=true&last_updated=2020-08-10T08%3A27%3A43.704Z
Authorization: Bearer {{apikey}} 

[{
    "GPS": {
        "valid": true,
        "Lng": -125.6,
        "Spd": 48.7,
        "Alt": 13.4,
        "Dir": 124,
        "NSat": 10,
        "HDOP": 0.9,
        "Lat": -60.2
    },
    "updatedAt": "2020-09-16T11:47:23.246+10:00",
    "vehicle": {
        "name": "__TEST__3fe0a1552ef5187f 3fe2412b6b3b4871",
        "externalId": "3fc97481ed90e508",
        "registration": "3fe84a86bc563702",
        "vin": "12342",
        "id": 160160,
        "registrationState": "SA"
    }
...[snip - other vehicles]...
}]

The client is expected to process this payload, extract the most recent ‘updatedAt’ timestamp from the response payload, and make the next polling call using that timestamp in the ‘last_updated’ parameter.

Warning

There are no explicit limitations on polling times (other than the global request limits), but it is expected the client will exercise this API under “fair use” guidelines - typically no more frequent than once every 5 minutes.