TRACKbox Webhook Specification


Revisions

    Initial Document


Overview

The TRACKbox webhook is simply an HTTP client that sends device data to a specific HTTP endpoint and nothing more. Essentially, this allows any TRACKbox device to be integrated with any IoT platform that supports HTTP webhooks.


HTTP Request Definition

Method

POST

Headers

{“Content-Type”: “application/json”}

Body

JSON format (see definition  below)

URL

https://<third-party platform endpoint>

cURL equivalent assuming

$Body is the Body

curl -d ‘$Body  - H “Content-Type: application/json” -X POST https://<third-party platform endpoint>


Body

The body is in JSON format and is derived from the GPSengine Connect protocol. Thus, it has the top-level field data that contains a non-empty list. This list contains dictionaries of device data that has the following fields:


Data Fields


ts


Description: The timestamp for when the device data was obtained by the device.

Format: string

    Unix timestamp

 


state


Description: The current state of the device.

Format: uint8

Values:

    Stopped = 0
    Moving = 1
    No GPS = 3


mode


Description: The current  mode of the device.

Format: uint8

Values:

    Normal = 0
    Alert = 1
    Valet = 2


lat


Description: Latitude.

Format: float

    Decimal Degrees


lon


Description: Longitude.

Format: float

    Decimal Degrees


altitude


Description: Altitude in units of 8 meters.

Format: uint8


speed


Description: Speed in km/h.

Format: uint8


heading


Description: Heading in units of 2 degrees.

Format: uint8

 


reason


Description: Reason that the point was captured with values.

Format: uint8

Values:

    State = 1
    Distance = 2
    Time = 4
    IO = 8
    Heartbeat = 16
    Alarm = 20
    BT Alarm = 21
    Panic = 64
    Accident = 128


ignition


Description: Ignition status.

Format: String

Values:

    On = “t”
    Off = “f”


pto


Description: Power take-off status.

Format: String

Values:

    On = “t”
    Off = “f”

 

 

 

gpsfix


Description: GPS fix status.

Format: String

Values:

    On = “t”
    Off = “f”


numsats


Description: Number of satellites

Format: uint8


power


Description: External power value

Format: float in units of 200mV


battery


Description: Battery power value

Format: float in units of 200mV


hdop


Description: Horizontal Dilution of Precision

Format: uint8

 

 

cellqual


Description: Cellular signal quality

Format: uint8


network


Description: Network status

Format: uint8

Values:

    Unknown = 0
    Vodafone NZ = 1
    Vodafone AU = 2
    Telecom XT = 3


lac


Description: Location Area Code per network

Format: uint8


cid


Description: Cell Id

Format: uint32


temp


Description: Temperature in degrees celsius

Format: float

 

 

Example Data


{

  “data”: {

    [

      {

        “ts”: “1536310278”,

        “state”: 0,

        “mode”: 0,

        “lat”: -27.61829499999999,

        “lon”: 153.12628166666667,

        “altitude”: 48,

        “speed”: 0,

        “Heading”: 0,

        “reason”: 0,

        “ignition”: “t”,

        “pto”: “f”,

        “gpsfix”: “t”,

        “numsats”: 4,

        “power”: 14.0,

        “battery”: 4.0,

        “hdop”: 16,

        “cellqual”: 27,

        “network”: 0,

        “lac”: 0,

        “cid”: 0,

        “temp”: 5.0

      }

    ]

  }

}