1. Home
  2. User Guides
  3. RESTful API Documentation
  4. 3D Mini & MeshHub API Integration

3D Mini & MeshHub API Integration

Introduction

If a customer decides to integrate the mini and MeshHub hardware into their own system, they can re-route the destination of data POST requests from the MeshHub to an alternate HTTP endpoint using its Bluetooth configuration feature. Once configured, the MeshHub will send a data stream to this endpoint, comprising three distinct payloads: 'In/Out Count', 'GPS Data', and 'Heartbeat'.

Schematic Diagram for API Integration

Sample data output for payloads (From MeshHub)

Once configured, the datastream from MeshHub will be directed to the new destination endpoint, which the customer has to set up on their own server. Below are the example format of the payload being streamed to the new endpoint.

In/Out Count Payload

In/Out count keep track of the number of passengers going in/out of the transportation between the current time and the previous time

{"uid": "<string>",

"type": 0,

"in": <int>,

"out": <int>,

"ts": "<ISO8601 timestamp>"}

uid - the unique device identifier

in- 'in' count

out- 'out' count

ts - UTC timestamp in ISO8601 format

GPS Data Payload

GPS data sends the current longitude and latitude of the device to pinpoint the location of the transportation.

{"uid": "<string>",

"type": 1,

"lat": <float>,

"long": <float>,

"ts": "<ISO8601 timestamp>"}

uid - the MeshHub's unique device identifier

lat - Latitude

long - Longitude

ts - UTC timestamp in ISO8601 format

Heartbeat Data Payload

Heartbeat data identifies the state of each device over various time periods, which is crucial for detecting malfunctions.

{"uid": "<string>",

"serial": "<string>",

"ts": "<ISO8601 timestamp>",

"type": 5,"online": 1}

uid - the MeshHub's unique device identifier

Serial - serial number for the device

ts - UTC timestamp in ISO8601 format

Updated on December 6, 2023