Getting started
Firstly, you’ll want to check if your telematics provider supports realtime. To check, go to the Providers page and see if your provider has Real-Time Status available, as not all providers support this feature. There are three methods of receiving realtime data from your telematics provider with PathStack. These are:- Webhooks
- WebSockets
- Polling
Realtime data collection methods
Webhook
A webhook is an HTTP-based callback function that allows lightweight, event-driven communication between 2 APIs. To set up a webhook, you will need to provide PathStack a unique URL, as well as filters defining what events PathStack should send to your server. The URL must be able to accept POST requests. To create a webhook, use the/webhook [POST] endpoint. For testing, you can use a webhook testing service such as
https://webhook.site to generate a URL that you can use for testing webhooks.
JSON
JSON
WebSocket
WebSocket is a protocol enabling simultaneous two-way communication over a single TCP connection. It allows full-duplex interaction between a client and server with lower overhead compared to HTTP polling, facilitating real-time data transfer. This protocol maintains an open connection, enabling the server to send content to the client without initial client requests and allowing continuous message exchange. When using WebSockets for realtime data collection with PathStack, you will have to first get a connection URL using the/realtime/connect endpoint. This will return a unique URL which you can use to create a WebSocket connection with
PathStack. See below for an example of how to connect to PathStack over WebSockets using that URL. Note, you will need
to install the websockets library with pip install websockets.
Python
JSON
JSON
Polling
Polling is another method of realtime data collection where a client continually requests data from a server (e.g. making a request every second). PathStack provides a realtime positions endpoint that fulfills this requirement by returning the most recent position of each device. To get realtime positions using polling, use the/realtime/device endpoint. You can also pass through a filter and
options.
Python
JSON
Filters
For realtime data you can provide filters to control what data you receive. Filters are optional, if no filters are provided then data from all devices will be sent. There are 4 types of filters that you can utilise:-
Connection ID Filter
You can specify the connection IDs that you wish to collect data for.
type: list of uuid -
Tag Filter
You can specify the tags of Devices which you wish to collect data for. This will only match devices which have
all the specified tags.
type: list of string -
Device ID Filter
You can specify the device IDs that you wish to collect data for.
type: list of uuid -
Connection Device Filter
You can specify which system devices IDs for a connection to collect data for.
type: list of object with connection ID of type uuid and system device IDs of type list of string
🚧 Planned features
The following features are planned for development. Please contact us on 1300 822 370 to find out more!Trip milestones
If you give us details about your delivery such as the start point/time and end point/time, we can provide regular updates on ETA to the destination, as well as milestones during the delivery. These milestones include:- the delivery has started
- the delivery has been delayed
- the delivery has been completed
- …many others to come

