Automatically translate this page?

How To Send Messages To Telematics Hub From My Custom Solution Via HTTP?

Putting the telemetry data from a third-party app into the flespi channel.

The entry point to the Telematics Hub is a channel. The channel operated over HTTP protocol is ab HTTP server capable to accept special requests with messages to Telematics Hub. 

Step 1. Create HTTP channel

create http flespi channel

  1. Navigate to the Channels tab

  2. Click the “+” button

  3. Select HTTP protocol in the protocol_id field

  4. Click Save

Step 2. Configure the request to your HTTP channel

HTTP requests specifications:

  • Method: POST

  • URI: taken from your channel’s card. Looks like gw.flespi.io:{your dedicated port}

  • HTTP/HTTPS: optional, may be selected in the channel configuration

  • Authorization: not required as you use your dedicated URI

  • Data - JSON array of objects. Each object represents a single message. To be accepted by Telematics Hub message must be identified. There must be a field in the message that will be treated as the message origin identifier. By default you may use “ident” name which is native for flespi. However, in channel configuration, you may specify any custom field name.

flespi http channel settings

E.g. for the configuration above the valid curl request to send a message to flespi will look like:

curl -X POST 
-d '[{"vehicle_id":"1234","position.latitude":52,"position.longitude":48}]'
https://gw.flespi.io:31460

And the result will be displayed in the channel’s Toolbox:

flespi http channel toolbox

3. Valuable notes

If you want the parameter naming of your custom messages to be in sync with parameters accepted by other channels, use standard flespi parameter naming. E.g. if you want to pass the object’s latitude and longitude and see it on TrackIt, use parameter name “position.latitude” and “position.longitude”.


See also
Helping you quickly go through the real-life issues.
Forwarding telemetry data into the advanced fleet management system.