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
Navigate to the Channels tab
Click the “+” button
Select HTTP protocol in the protocol_id field
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 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.
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}]' https://gw.flespi.io:31460
And the result will be displayed in the channel’s 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”.