Forwarders API
API documentation for forwarders
Parameters
Update
param | type | description |
---|---|---|
dates_format | string | default: ISOFORMAT (YYYY-MM-DDTHH:MM:SS+HH:MM), python dateformat compatible |
time_zone | string | default: UTC (recommended), timezone |
extra_headers | object | default: Content-Type: application/json |
include_vinfo | boolean | if true, sends an object with the entities information |
general | object | update the general config (see below) |
To update a forwarder, you can use a PUT
request on the forwarder ID to update the general configuration.
When sending the request, make sure to use the entire JSON object as the body of the PUT
request, with the modifications.
general params | type | description |
---|---|---|
discard | boolean | discards old messages in queue & any new messages |
keys | array | use it to only forward certain keys |
keys_all | boolean | use it to forward all keys |
keys_include | array | use it to include keys that are not defined in the base set (has priority over keys) |
keys_exclude | array | use it to exclude any keys from the forwarder |
stop_send | boolean | when true it stops the forwarder and queues events |
stop_queue | boolean | when true it stops queuing events, discarding any new events |
labels_in | array | only allows certain labels to forward data |
labels_out | array | exclude the following labels from forwarding data |
default_values | object | key and default value, ex: {"ib": "000000000000"} |
include_primary | boolean | when true along with the field primary in keys or keys_include it includes a key called primary which contains the vehicle's information and custom properties |
legacy general params | type | description |
---|---|---|
legacy | boolean | when true it sends the lat/lon as whole integers values |
protocol | string | when set to "rpc", it wraps the json array of events in the following envelope {"params":[2,[{EVENT_1},{EVENT_2}]],"method":"pushevents","id":1} |
codes_map | json | object with key-value pairs, the keys should be the original event_code, the value represents the value to which it will be switched |
filter_in | array | only forwards events from these event codes |
filter_out | array | removes any unwanted event codes from forwarding data |
Don't forget to send the entire payload
dates_format
PUT /forwarders/:id
{
"dates_format": "%Y-%m-%d %H:%M:%S"
}
this gives you dates with:
YYYY-MM-DD hh:mm:ss
, example:2018-12-25 23:59:59
time_zone
PUT /forwarders/:id
{
"time_zone": "America/New_York"
}
keys
PUT /forwarders/:id
{
"general": {
"keys": [
"lat",
"lon",
"speed",
"primary_name",
"event_time"
]
}
}
[
{
"lat": -34.88844,
"lon": -56.11606,
"speed": 33,
"primary_name": "Blue Toyota",
"event_time": "2018-12-17T14:22:09+00:00",
"system_time": "2018-12-17T14:51:37.969868+00:00"
}
]
extra_headers
PUT /forwarders/:id
{
"extra_headers": {
"Authorization": "Bearer YWRqZmFsZGpmbGFqc2RmbGFhZGxmam"
}
}
primary
PUT /forwarders/:id
{
"include_primary": true,
"keys_include": [
"primary"
]
}
[
{
"vid": 2292,
"lon": -80.19266,
"primary": {
"info": {
"range_unit": "mile",
"description": "Sample vehicle",
"tank_volume": null,
"color": "Black",
"make": "Peterbilt",
"vin": null,
"license_plate": "ABC123",
"alias": "foxtrot",
"range": 400,
"year": "2020",
"model": "567",
"tank_unit": "gallon"
},
"associations": [
{
"device": 862831032123456,
"time": 1592847039,
"id": 86,
"association": true,
"vehicle": 2292
}
],
"__updated": 1596475523.951629,
"associated_at": 1592847871,
"name": "My special car",
"primary": 9,
"__created": 1592607412.826321,
"images": {
"photo": false,
"on_icon": false,
"idle_icon": false,
"off_icon": false,
"icon": false
},
"token": null,
"properties": {
"custom_properties": "yes",
"network": "4G",
"city": "FLORIDA",
"sensor": "v1.2",
"ID": "10073367",
"region": "SOUTH",
"my_info": {
"code": "11223344",
"state": "UPDATING"
},
"country": "US"
},
"groups": [
6
],
"__version": "5.3.2",
"device": 862831032123456,
"configuration": "0000",
"type": "vehicle",
"id": 2292
},
"label": "new",
"lat": 26.68205,
"device_id": 862831032123456
}
]
Updated over 2 years ago