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{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 the 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", "timestamp":1234567890, "position.latitude":52, "position.longitude":48, "position.speed":55, "position.direction":75, "fuel.level":87}]'

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 names “position.latitude” and “position.longitude”.

See also
Using flespi plugins to remove the location data from telemetry messages according to the specified schedule.
Using plugins to resolve the coordinates of GSM base stations into position coordinates using Wialon LBS geocoding and add them into the device messages.