API Documentation

Endpoints#

GET https://gps.logistimatics.com/api/devices

GET https://gps.logistimatics.com/api/positions

GET https://gps.logistimatics.com/api/sensor

Authentication#

Send the following header with each request:

Authorization: Bearer API_KEY

With API_KEY set to the API key you received from us.

Parameters#

Send the following query parameters:

  • device_id: Numeric (required). Logistimatics’ device serial number. Device serial numbers are on a sticker on the device and look like 0000-01234. For this API, only the digits past the hyphen are needed and leading zeroes can be elided (e.g. 01234 or 1234).
  • start_at: Numeric (optional). Seconds since Unix epoch. Defaults to 1 day before end_at.
  • end_at: Numeric (optional). Seconds since Unix epoch. Defaults to now.

Response#

For /devices, you will receive JSON response formatted like:

[
  {
    "device_id": "00000-02378",
    "name": "Shipment tracker",
    "last_ping_at": "2018-07-02T04:11:26.000Z",
    "battery_percentage": 5,
    "last_position_at": "2018-07-01T21:20:41.000Z",
    "latitude": 36.0904711111111,
    "longitude": -79.8008877777778,
    "address": "1201-1203 Grayland St, Greensboro, NC 27408, USA",
    "accuracy": 0
  },
  {
    "device_id": "00000-01131",
    "name": "#01131 Mobile-200",
    "last_ping_at": "2018-07-12T17:42:49.000Z",
    "battery_percentage": 50,
    "last_position_at": "2018-07-12T17:30:51.000Z",
    "latitude": 36.0670288888889,
    "longitude": -79.7904977777778,
    "address": "511 South Elm Street, Greensboro, NC 27406",
    "accuracy": 0
  },
  {
    "device_id": "00000-02236",
    "name": "#02236 Auto-320",
    "last_ping_at": "2018-07-12T17:43:14.000Z",
    "battery_percentage": 89,
    "last_position_at": "2018-07-12T17:05:46.000Z",
    "latitude": 36.08699,
    "longitude": -79.77139,
    "address": "1080 Homeland Avenue, Greensboro, NC 27405",
    "accuracy": 0
  }
]

For /positions, you will receive a JSON response formatted like:

[
  {
    "latitude": 43.3020888888889,
    "longitude": -96.44688,
    "address": "1696 Us 18 St, Lyon County, IA, USA",
    "timestamp": "2018-01-04T17:49:09+00:00",
    "accuracy": 0,
    "fix": "gps"
  },
  {
    "latitude": 43.30216,
    "longitude": -96.45152,
    "address": "1696 Us 18 St, Lyon County, IA, USA",
    "timestamp": "2018-01-04T17:48:49+00:00",
    "accuracy": 1000,
    "fix": "cell"
  },
  {
    "latitude": 43.3022355555556,
    "longitude": -96.4560622222222,
    "address": "1696 Us 18 St, Lyon County, IA, USA",
    "timestamp": "2018-01-04T17:48:29+00:00",
    "accuracy": 10,
    "fix": "wifi"
  }
]

Some of our devices provide temperature or other environmental information which is available through the /sensor endpoint. Currently this endpoint is in beta.

Responses are limited to 10,000 records. Our trackers do not report more frequently than once every 20 seconds, so you should be able to pull 1-2 days worth of records at a time. We keep position records for 60 days.

Example#

As a quick test, you might try

export API_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJvcmdhbml6YXRpb25faWQiOjI5MDcsImlhdCI6MTUyNDIzMjY0MH0.Y7V5DrNln059CxLpvlikp2MZ_0zY8I-pfD4EPqglrd4
curl -H "Authorization: Bearer ${API_KEY}" 'https://gps.logistimatics.com/api/positions?device_id=1131'