Vehicles

Vehicle is an core resource representing tracking object.

The Vehicle Object

Attributes

  • idNumberRequiredReadonlyVehicle ID
  • typeStringType of vehicle
  • modelStringModel of vehicle
  • markStringA vehicle registration plate
  • noteStringAny kind of additional information about the vehicle
  • fuel_tank_litresNumberFuel tank of the vehicle in the litres
  • expenses_per_hNumberCost per hour
  • expenses_per_kmNumberCost per kilometer
  • device_idNumberReadonlyDevice ID linked to the vehicle
  • gps_device_idStringReadonlyIMEI of the device installed in the vehicle
  • speedNumberReadonlyCurrent speed of the vehicle (in km/h)
  • last_change_timeNumberReadonlyLast time the vehicle changed status
  • timestampNumberReadonlyThe last time vehicle send coordinates
  • statusStringReadonlyStatus of the vehicle, can be: "stopped", "active" or "inactive"
  • driverVehicleDriverObjectReadonlyExpandableActive driver of the vehicle
  • positionVehiclePositionObjectReadonlyExpandablePosition of the vehicle
  • sensorsVehicleSensorObjectReadonlyExpandableArray of the vehicles sensors
  • displayparamsSingleVehicleSensorObjectReadonlyExpandableArray of the single vehicle display params.
  • labelsStringReadonlyExpandableArray of the vehicle labels
  • fmsVehicleFMSObjectReadonlyExpandableVehicle FMS data

Vehicle object

{
    "id": 456,
    "type": "Pickup",
    "mark": "ZG-123-G",
    "model": "FORD",
    "note": "Notes about the vehicle",
    "fuel_tank_litres": 60,
    "status": "stopped",
    "device_id": 123,
    "gps_device_id": "352294043653467",
    "last_change_time": 1598875073,
    "last_active_time": 1598875393,
    "speed": 56,
    "labels": [
        "Truck",
        "Delivery"
    ],
    "driver": {
        "id": 3,
        "name": "John Williams"
    },
    "position": {
        "timestamp": 1598875393,
        "lat": 45.781506,
        "lng": 16.013359,
        "address": "Miševečka ulica 15, Zagreb"
    },
    "displayparams": [
      {
        "id": 1,
        "name": "Voltage",
        "sensor": 78,
        "order": 1,
        "transform": "${value}",
        "unit": "V",
        "show_info": true,
        "show_map": false,
        "show_graph": true
      }
    ],
    "sensors": [
        {
            "sensor": 78,
            "value": 140
        },
        {
            "sensor": 87,
            "value": 195621000
        }
    ]
}

List all vehicles

GEThttps://api.giscloud.com/1/vehicles.json

Get list of all vehicles on the current Track app instance.

Query Parameters

Attribute name Description
app_instance_id App instance ID
expand Expand by 'fms', 'position', 'sensors', 'driver' and 'labels'

Responses

Code Description
200 Operation successful

Expand

Expand option Description
fms Get vehicle FMS data if has one
position Vehicle position
labels List of the labels attached to vehicle
driver Currently registered vehicle driver
sensors Returns array of the sensors for the last point

Sensors

Sensor Description
1 & 239 Kontakt
2 Sensor 2
3 Sensor 3
9 Analog fuel sensor probe
36 & 66 & 87 (LV CAN) & 105 & 112 (FMS) & 217 Odometer
72 Temperature
78 & 207 Driver check-in
30 & 80 & 81 Wheel speed
82
33 & 83 & 86 & 107 & 138 & 213 Total fuel used
34 Fuel level
84 CAN Fuel Level

Raptor: “U starija vozila i strojeve ne ugrađujemo CAN module jer ne podržavaju taj protokol pa ugrađujemo sonde u rezervoar, a sa sonde dolazi podatak o mV na senzor 9 i kroz kalibraciju (formule za kalibraciju u više točaka) se mV pretvaraju u litre.”
35 & 85 & 88 & 104 & 113 & 216 Engine speed (RPM)
37 & 87 (non-LVC) & 89 & 108 & 218 Fuel level (%)
90
100
115
201 Teltonika digital fuel sensor
253 Risk driving
254 Risk driving force

Example request

curl -H "API-Key: {USER_API_KEY}" https://api.giscloud.com/1/vehicles.json?app_instance_id={APP_INSTANCE_ID}

Example response

{    
"type": "vehicles",
"total": 74,
"page": 1,
"data": [
    "id": 456,
    "type": "Pickup",
    "mark": "ZG-123-G",
    "model": "FORD",
    "note": "Notes about the vehicle",
    "fuel_tank_litres": 60,
    "status": "stopped",
    "device_id": 123,
    "gps_device_id": "352294043653467",
    "last_change_time": 1598875073,
    "last_active_time": 1598875393,
    "speed": 56,
    "labels": [
        "Truck",
        "Delivery"
    ],
    "driver": {
        "id": 3,
        "name": "John Williams"
    },
    "position": {
        "timestamp": 1598875393,
        "lat": 45.781506,
        "lng": 16.013359,
        "address": "Miševečka ulica 15, Zagreb"
    },
    "displayparams": [
      {
        "id": 1,
        "name": "Voltage",
        "sensor": 78,
        "order": 1,
        "transform": "${value}",
        "unit": "V",
        "show_info": true,
        "show_map": false,
        "show_graph": true
      }
    ],
    "sensors": [
        {
            "sensor": 78,
            "value": 140
        },
        {
            "sensor": 87,
            "value": 195621000
        }
    ]
  // ...
  ]
}

Retrieve a vehicle

GEThttps://api.giscloud.com/1/vehicles/{VEHICLE_ID}.json

Get the single vehicle data

Responses

Code Description
200 Operation successful

Example request

curl -H "API-Key: {USER_API_KEY}" https://api.giscloud.com/1/vehicles/456.json?app_instance_id={APP_INSTANCE_ID}

Example response

{    
    "id": 456,
    "type": "Pickup",
    "mark": "ZG-123-G",
    "model": "FORD",
    "note": "Notes about the vehicle",
    "fuel_tank_litres": 60,
    "status": "stopped",
    "device_id": 123,
    "gps_device_id": "352294043653467",
    "last_change_time": 1598875073,
    "last_active_time": 1598875393,
    "speed": 56,
    "labels": [
        "Truck",
        "Delivery"
    ],
    "driver": {
        "id": 3,
        "name": "John Williams"
    },
    "position": {
        "timestamp": 1598875393,
        "lat": 45.781506,
        "lng": 16.013359,
        "address": "Miševečka ulica 15, Zagreb"
    },
    "sensors": [
        {
            "sensor": 78,
            "value": 140
        },
        {
            "sensor": 87,
            "value": 195621000
        }
    ]
}

Update a vehicle

PUThttps://api.giscloud.com/1/vehicles/{VEHICLE_ID}.json

Update vehicle properties.

Responses

Code Description
204 Operation successful
403 Action forbidden
404 Resource not found

Example request

curl -H "API-Key: {USER_API_KEY}" -X PUT -d {"note": "here goes any text"} https://api.giscloud.com/1/vehicles/456.json?app_instance_id={APP_INSTANCE_ID}

Delete a vehicle

Not supported since only Admin is allowed to manage vehicles.

Get vehicle position history

GEThttps://api.giscloud.com/1/vehicles/{VEHICLE_ID}/paths.json?from={FROM}&to={TO}

Get vehicle position history between 'from' and 'to'.

Query Parameters

Attribute name Description
app_instance_id App instance ID
vehicle_id Vehicle ID
from From in UNIX timestamp
to To in UNIX timestamp
show_hidden Flag to return hidden paths

Responses

Code Description
200 Operation successful
403 Action forbidden
404 Resource not found

Example request

curl -H "API-Key: {USER_API_KEY}" https://api.giscloud.com/1/vehicles/{VEHICLE_ID}/paths.json?from=1516612165&to=1516698565&app_instance_id={APP_INSTANCE_ID}

Example response

{
    "page": 1,
    "total": 4,
    "data": [
        {
            "id": 9937,
            "visibility": true,
            "start_time": 1516627404,
            "stop_time": 1516629962
        },
        {
            "id": 9939,
            "visibility": true,
            "start_time": 1516630859,
            "stop_time": 1516634288
        },
        {
            "id": 9943,
            "visibility": true,
            "start_time": 1516635950,
            "stop_time": 1516636209
        },
        {
            "id": 9944,
            "visibility": true,
            "start_time": 1516641394,
            "stop_time": 1516642601
        }
    ],
    "bound": {
        "xmin": 11.262326,
        "xmax": 11.47475,
        "ymin": 47.199844,
        "ymax": 47.277885
    }
}

Get path geometry from the vehicle history

GEThttps://api.giscloud.com/1/vehicles/{VEHICLE_ID}/paths/{PATH_ID}.json

Get more information about the vehicle history path (segment).

Query Parameters

Attribute name Description
app_instance_id App instance ID
vehicle_id Vehicle ID
path_id Single Path ID from /paths.json response

Responses

HTTP Code Description
200 Operation successful
403 Action forbidden
404 Resource not found

Parameters in response

Param Description
geom Geometry of the vehicle path (in WKT)
length Distance (m)
start_time Start time of a path
stop_time Stop time of path
bound Bounding box that bounds a path
start GPS position of a path start
end GPS position of a path end

Example request

curl -H "API-Key: {USER_API_KEY}" https://api.giscloud.com/1/vehicles/{VEHICLE_ID}/paths/9937.json?app_instance_id={APP_INSTANCE_ID}

Example response

{
  "geom": "LINESTRING(18.032343 42.690315,18.032318 42.690273,18.03 ...", // in WKT
  "path": "9937",
  "visibility": true,
  "start_time": 1555407423,
  "stop_time": 1555409904,
  "length": 22425.90,
  "bound": {
    "xmax": 18.193233,
    "xmin": 18.032318,
    "ymax": 42.702518,
    "ymin": 42.622478
  },
  "start": {
    "lat": 18.032343,
    "lng": 42.690315
  },
  "end": {
    "lat": 18.185925,
    "lng": 42.632015
  }
}

Get a vehicle history info on exact coordinates

GEThttps://api.giscloud.com/1/vehicles/{VEHICLE_ID}/history/point.json

Get history vehicle status on the exact coordinates.

Query Parameters

Attribute name Description
app_instance_id App instance ID
vehicle_id Vehicle ID
lat Latitude position
long Longitude position
paths List of the paths

Responses

HTTP Code Description
200 Operation successful
403 Action forbidden
404 Resource not found

Example request

curl -H "API-Key: {USER_API_KEY}" https://api.giscloud.com/1/vehicles/{VEHICLE_ID}/history/point.json?app_instance_id={APP_INSTANCE_ID}&lat=1614399.6393412165&long=5546151.712743359&paths=142401,142403,142405,142407,142409,142411,142413,142415,142417,142419,142421

Example response

{
    "id": "184673079",
    "timestamp": "1514991037",
    "altitude": "31",
    "angle": "0",
    "speed": "0",
    "server_time": "2018-01-03 14:50:39.358956+00",
    "contact": "0",
    "path": "142419",
    "vehicle": "NN 123 OO",
    "driver": "Ime Vozaca",
    "latitude": "1614399.81723207",
    "longitude": "5546151.69605408",
    "address": "Velika Ulica bb, Neki Grad"
}

Get a vehicle history chart data

GEThttps://api.giscloud.com/1/vehicles/{VEHICLE_ID}/history/chart.json

Get history vehicle status on the exact coordinates.

Query Parameters

Attribute name Description
app_instance_id App instance ID
vehicle_id Vehicle ID
from From in UNIX timestamp
to To in UNIX timestamp
type Possible values 'speed', 'engine_speed', 'altitude', ...
epsg EPSG code; Coordinate Reference System

Responses

HTTP Code Description
200 Operation successful
403 Action forbidden
404 Resource not found

Example request

curl -H "API-Key: {USER_API_KEY}" https://api.giscloud.com/1/vehicles/{VEHICLE_ID}/history/chart.json?app_instance_id={APP_INSTANCE_ID}&from=1530786932&to=1530787932&type=speed&epsg=4326

Example response

{
    "data": [
        {
            "time": "1598921700",
            "point": "15.941971,45.79187",
            "value": "0"
        },
        {
            "time": "1598921760",
            "point": "15.941969,45.791866",
            "value": "0"
        },
        //...
    ]
}

Vehicle Labels

Vehicle label object represent any custom label that can be attached to the vehicle to group or organize large number of vehicles.

Vehicle Label object

Attributes

  • idNumberRequiredReadonlyLabel ID
  • labelStringLabel name
  • colorStringLabel RGB color

Example Vehicle Label object

{
    "id": 1,
    "label": "TRUCK",
    "color": "#c0504d"
}

List all available vehicle labels

GEThttps://api.giscloud.com/1/vehiclelabels.json

Example Request

curl -H "API-Key: {USER_API_KEY}" https://api.giscloud.com/1/vehiclelabels.json?app_instance_id={APP_INSTANCE_ID}

Example Response

{
  "type": "vehiclelabels",
  "total": 2,
  "page": 1,
  "data": [
    {
      "id": 1,
      "label": "TRUCK",
      "color": "#c0504d"
    },
    {
      "id": 2,
      "label": "DELIVERY",
      "color": "#fccb00"
    }
  ]
}

Create new vehicle label

POSThttps://api.giscloud.com/1/vehiclelabels.json

Responses

Code Description
201 Operation successful
403 Action forbidden
404 Resource not found

Example Request

curl -H "API-Key: {USER_API_KEY}" -X POST -d '{"label": "new label", "color": "0xff0000"}' https://api.giscloud.com/1/vehiclelabels.json?app_instance_id={APP_INSTANCE_ID}

Update the vehicle label

PUThttps://api.giscloud.com/1/vehiclelabels/{VEHICLE_LABEL_ID}.json

Responses

Code Description
204 Operation successful
403 Action forbidden
404 Resource not found

Example Request

curl -H "API-Key: {USER_API_KEY}" -X PUT -d '{"label": "label", "color": "0xff00FF"}' https://api.giscloud.com/1/vehiclelabels/{VEHICLE_LABEL_ID}.json?app_instance_id={APP_INSTANCE_ID}

Delete a vehicle label

DELETEhttps://api.giscloud.com/1/vehiclelabels/{VEHICLE_LABEL_ID}.json

Responses

Code Description
204 Operation successful
403 Action forbidden
404 Resource not found

Example Request

curl -H "API-Key: {USER_API_KEY}" -X DELETE https://api.giscloud.com/1/vehiclelabels/{VEHICLE_LABEL_ID}.json?app_instance_id={APP_INSTANCE_ID}

Get labels of the vehicle

GEThttps://api.giscloud.com/1/vehicles/{VEHICLE_ID}/labels.json

Example Request

curl -H "API-Key: {USER_API_KEY}" https://api.giscloud.com/1/vehicles/{VEHICLE_ID}/labels.json?app_instance_id={APP_INSTANCE_ID}

Example Response

{
  "type": "vehiclelabels",
  "total": 2,
  "page": 1,
  "data": [
    {
      "id": 1,
      "label": "TRUCK",
      "color": "#c0504d"
    },
    {
      "id": 2,
      "label": "DELIVERY",
      "color": "#fccb00"
    }
  ]
}

Assign label to the vehicle

POSThttps://api.giscloud.com/1/vehicles/{VEHICLE_ID}/labels.json

Assign label to the vehicle.

Responses

Code Description
201 Operation successful
403 Action forbidden
404 Resource not found

Example Request

curl -H "API-Key: {USER_API_KEY}" -X POST -d '{"id": {VEHICLE_LABEL_ID} }' https://api.giscloud.com/1/vehicles/{VEHICLE_ID}/labels.json?app_instance_id={APP_INSTANCE_ID}

Remove label from the vehicle

DELETEhttps://api.giscloud.com/1/vehicles/{VEHICLE_ID}/labels.json

Remove label from the vehicle.

Responses

Code Description
204 Operation successful
403 Action forbidden
404 Resource not found

Example Request

curl -H "API-Key: {USER_API_KEY}" -X DELETE https://api.giscloud.com/1/vehicles/{VEHICLE_ID}/labels/{VEHICLE_LABEL_ID}.json?app_instance_id={APP_INSTANCE_ID}

The Driver Object

Attributes

  • idNumberRequiredReadonlyDriver ID
  • nameStringDriver name
  • emailStringDriver email
  • keyStringKey for authentication
  • noteStringDriver note

Driver object

{
    "id": 123,
    "name": "John Miller",
    "email": "driver@gmail.com",
    "key": "abc",
    "note": "The driver"
}

List all Drivers

GEThttps://api.giscloud.com/1/drivers.json

Get list of all drivers on the current Track app instance.

Query Parameters

Attribute name Description
app_instance_id App instance ID

Responses

Code Description
200 Operation successful

Example request

curl -H "API-Key: {USER_API_KEY}" https://api.giscloud.com/1/drivers.json?app_instance_id={APP_INSTANCE_ID}

Example response

{    
"type": "drivers",
"total": 2,
"page": 1,
"data": [
  {
    "id": 123,
    "name": "John Miller",
    "email": "driver@gmail.com",
    "key": "abc",
    "note": "The driver"
  },
  {
    "id": 125,
    "name": "Bruce ",
    "email": "bruce@gmail.com",
    "key": "dfg",
    "note": ""
    }
  ]
}

Retrieve a Driver

GEThttps://api.giscloud.com/1/drivers/{DRIVER_ID}.json

Get the single Driver data

Responses

Code Description
200 Operation successful

Example request

curl -H "API-Key: {USER_API_KEY}" https://api.giscloud.com/1/drivers/456.json?app_instance_id={APP_INSTANCE_ID}

Example response

{    
    "id": 456,
    "name": "John Miller",
    "email": "driver@gmail.com",
    "key": "abc",
    "note": "The driver"
}

Update a Driver

PUThttps://api.giscloud.com/1/drivers/{DRIVER_ID}.json

Update Driver properties.

Responses

Code Description
204 Operation successful
403 Action forbidden
404 Resource not found

Example request

curl -H "API-Key: {USER_API_KEY}" -X PUT -d {"name": "New name"} https://api.giscloud.com/1/drivers/456.json?app_instance_id={APP_INSTANCE_ID}

Delete a Driver

DELETEhttps://api.giscloud.com/1/drivers/{DRIVER_ID}.json

Responses

Code Description
204 Operation successful
403 Action forbidden
404 Resource not found

Example Request

curl -H "API-Key: {USER_API_KEY}" -X DELETE https://api.giscloud.com/1/drivers/123.json?app_instance_id={APP_INSTANCE_ID}

The Vehicle Driver Object

Attributes

  • idNumberRequiredReadonlyVehicle Driver ID
  • driver_idIntegerRequiredDriver ID
  • start_tTimestampRequiredStart (UNIX) timestamp
  • stop_tTimestampStop (UNIX) timestamp

Vehicle Driver object

{
    "id": 1,
    "driver_id": 123,
    "start_t": 1608064080,
    "stop_t": null
}

List all drivers for a vehicle

GEThttps://api.giscloud.com/1/vehicles/{VEHICLE_ID}/drivers.json

Get list of all drivers for the {VEHICLE_ID} vehicle.

Query Parameters

Attribute name Description
app_instance_id App instance ID

Responses

Code Description
200 Operation successful

Example request

curl -H "API-Key: {USER_API_KEY}" https://api.giscloud.com/1/vehicles/55/drivers.json?app_instance_id={APP_INSTANCE_ID}

Example response

{    
"type": "vehicledrivers",
"total": 2,
"page": 1,
"data": [
  {
    "id": 1,
    "driver_id": 123,
    "start_t": 1606809620,
    "stop_t": 1606824020
  },
  {
    "id": 2,
    "driver_id": 456,
    "start_t": 1606824020,
    "stop_t": 1606831220
    }
  ]
}

Retrieve a Vehicle Driver

GEThttps://api.giscloud.com/1/vehicles/{VEHICLE_ID}/drivers/{DRIVER_ID}.json

Get the single Vehicle Driver data on the vehicle {VEHICLE_ID}.

Responses

Code Description
200 Operation successful

Example request

curl -H "API-Key: {USER_API_KEY}" https://api.giscloud.com/1/vehicles/55/drivers/1.json?app_instance_id={APP_INSTANCE_ID}

Example response

{    
    "id": 1,
    "driver_id": 456,
    "start_t": 1606824020,
    "stop_t": 1606831220
}

Update a Vehicle Driver

PUThttps://api.giscloud.com/1/vehicles/{VEHICLE_ID}/drivers/{DRIVER_ID}.json

Update Vehicle Driver properties.

Responses

Code Description
204 Operation successful
403 Action forbidden
404 Resource not found

Example request

curl -H "API-Key: {USER_API_KEY}" -X PUT -d {"stop_t": 1606831220} https://api.giscloud.com/1/vehicles/55/drivers/1.json?app_instance_id={APP_INSTANCE_ID}

Delete a Vehicle Driver

DELETEhttps://api.giscloud.com/1/vehicles/{VEHICLE_ID}/drivers/{DRIVER_ID}.json

Responses

Code Description
204 Operation successful
403 Action forbidden
404 Resource not found

Example Request

curl -H "API-Key: {USER_API_KEY}" -X DELETE https://api.giscloud.com/1/vehicles/55/1.json?app_instance_id={APP_INSTANCE_ID}

Vehicle Display Parameters object

Attributes

  • idNumberRequiredReadonlyVehicle Display Param. ID
  • nameStringVehicle parameter name
  • fieldStringDatabase field
  • formatStringFormat of ther parameter

Vehicle Display Parameter object example

{
    "id": 1,
    "name": "Vehicle",
    "field": "mark",
    "format": "string"
}

List all available vehicle display parameters

GEThttps://api.giscloud.com/1/vehicledisplayparams.json

Responses

Code Description
200 Operation successful

Example Request

curl -H "API-Key: {USER_API_KEY}" https://api.giscloud.com/1/vehicledisplayparams.json?app_instance_id={APP_INSTANCE_ID}

Example Response

{
   "type": "vehicledisplayparams",
   "total": 39,
   "page": 1,
   "data": [
      {
         "name": "Vehicle",
         "id": 1,
         "field": "mark",
         "format": "string"
      },
      {
         "name": "Address",
         "id": 2,
         "field": "address",
         "format": "string"
      },
      {
         "name": "Time",
         "id": 3,
         "field": "timestamp",
         "format": "timestamp"
      },
      {
         "id": 4,
         "name": "Last change time",
         "field": "dt",
         "format": "period"
      },
      {
         "id": 5,
         "name": "Satellites No.",
         "field": "satellites",
         "format": "integer"
      },
      // ...
   ]
}

User Vehicle Display Parameters object

Attributes

  • idNumberRequiredReadonly
  • orderInteger
  • typeStringReadonly
  • display_paramVehicleDisplayParameterObjectExpandableVehicleDisplayParameterObject

Example User Vehicle Display Parameter object

{
    "id": 247,
    "order": 0,
    "type": 4,
    "display_param": {
        "id": 17,
        "name": "Speed",
        "format": "graph",
        "field": "speed"
    }
}

List all available user vehicle display parameters

GEThttps://api.giscloud.com/1/users/current/vehicledisplayparams.json

Query Parameters

Attribute name Description
app_instance_id App instance ID
expand Expand by 'param' to show display_param object
type Filter by type (possible values: 1, 2, 3 or 4)

Type codes

Type Description
1 Vehicle Info Panel
2 Vehicle List
3 Vehicle Tooltip
4 Graph

Responses

Code Description
200 Operation successful

Example Request

curl -H "API-Key: {USER_API_KEY}" "https://api.giscloud.com/1/users/current/vehicledisplayparams.json?app_instance_id={APP_INSTANCE_ID}&type=1"

Example Response

{
   "type": "uservehicledisplayparams",
   "total": 4,
   "page": 1,
   "data": [
      {
         "id": 247,
         "order": 0,
         "type": 4,
         "display_param": {
            "name": "Speed",
            "format": "graph",
            "field": "speed",
            "id": 17
         }
      },
      {
         "id": 248,
         "order": 1,
         "type": 4,
         "display_param": {
            "id": 18,
            "name": "Contact",
            "format": "graph",
            "field": "contact"
         }
      },
      {
         "id": 249,
         "order": 2,
         "type": 4,
         "display_param": {
            "id": 21,
            "name": "Altitude",
            "format": "graph",
            "field": "altitude"
         }
      },
      {
         "id": 250,
         "order": 3,
         "type": 4,
         "display_param": {
            "id": 20,
            "name": "Engine speed [RPM]",
            "format": "graph",
            "field": "engine_speed"
         }
      }
   ]
}

Create new vehicle display parameter

POSThttps://api.giscloud.com/1/users/current/vehicledisplayparams.json

Responses

Code Description
201 Operation successful
403 Action forbidden

Example Request

curl -H "API-Key: {USER_API_KEY}" -X POST -d '{"display_param_id": 1, "type": 1, "order": 2}' "https://api.giscloud.com/1/users/current/vehicledisplayparams.json?app_instance_id={APP_INSTANCE_ID}"

Update the vehicle display parameter

PUThttps://api.giscloud.com/1/users/current/vehicledisplayparams/{VEHICLE_DISPLAY_PARAM_ID}.json

Only "order" parameter can be changed.

Responses

Code Description
204 Operation successful
403 Action forbidden
404 Resource not found

Example Request

curl -H "API-Key: {USER_API_KEY}" -X PUT -d '{"order": 1}' "https://api.giscloud.com/1/users/current/vehicledisplayparams/{VEHICLE_DISPLAY_PARAM_ID}.json?app_instance_id={APP_INSTANCE_ID}"

Delete a vehicle display parameter

DELETEhttps://api.giscloud.com/1/users/current/vehicledisplayparams/{VEHICLE_DISPLAY_PARAM_ID}.json

Responses

Code Description
204 Operation successful
403 Action forbidden
404 Resource not found

Example Request

curl -H "API-Key: {USER_API_KEY}" -X DELETE "https://api.giscloud.com/1/users/current/vehicledisplayparams/{VEHICLE_DISPLAY_PARAM_ID}.json?app_instance_id={APP_INSTANCE_ID}"

Single Vehicle Display Parameters object

Attributes

  • idNumberRequiredReadonly
  • nameString
  • sensorInteger
  • orderInteger
  • transformString
  • unitString
  • show_infoBoolean
  • show_mapBoolean
  • show_graphBoolean

Example Single Vehicle Display Parameter object

{
    "id": 247,
    "name": "Voltage",
    "sensor": 85,
    "order": 1,
    "transform": "${value}",
    "unit": "V",
    "show_info": true,
    "show_map": false,
    "show_graph": true
}

List all available single vehicle display parameters

GEThttps://api.giscloud.com/1/vehicles/{VEHICLE_ID}/displayparams.json

Query Parameters

Attribute name Description
app_instance_id App instance ID

Responses

Code Description
200 Operation successful

Example Request

curl -H "API-Key: {USER_API_KEY}" "https://api.giscloud.com/1/vehicles/123/displayparams.json?app_instance_id={APP_INSTANCE_ID}"

Example Response

{
   "type": "vehicledisplayparams",
   "total": 4,
   "page": 1,
   "data": [
      {
        "id": 247,
        "name": "Voltage",
        "sensor": 85,
        "order": 1,
        "transform": "${value}",
        "unit": "V",
        "show_info": true,
        "show_map": false,
        "show_graph": true
      },
      {
        "id": 248,
        "name": "Custom Sensor",
        "sensor": 86,
        "order": 2,
        "transform": "${value}/100",
        "unit": "",
        "show_info": true,
        "show_map": true,
        "show_graph": false
      }      
   ]
}

Create new single vehicle display parameter

POSThttps://api.giscloud.com/1/vehicles/{VEHICLE_ID}/displayparams.json

Responses

Code Description
201 Operation successful
403 Action forbidden

Example Request

curl -H "API-Key: {USER_API_KEY}" -X POST -d '{"name": "Custom sensor", "sensor": 86}' "https://api.giscloud.com/1/vehicles/123/displayparams.json?app_instance_id={APP_INSTANCE_ID}"

Update the single vehicle display parameter

PUThttps://api.giscloud.com/1/vehicles/{VEHICLE_ID}/displayparams/{DISPLAY_PARAM_ID}.json

Responses

Code Description
204 Operation successful
403 Action forbidden
404 Resource not found

Example Request

curl -H "API-Key: {USER_API_KEY}" -X PUT -d '{"order": 1}' "https://api.giscloud.com/1/vehicleS/displayparams/248.json?app_instance_id={APP_INSTANCE_ID}"

Delete a single vehicle display parameter

DELETEhttps://api.giscloud.com/1/vehicles/{VEHICLE_ID}/displayparams/{DISPLAY_PARAM_ID}.json

Responses

Code Description
204 Operation successful
403 Action forbidden
404 Resource not found

Example Request

curl -H "API-Key: {USER_API_KEY}" -X DELETE "https://api.giscloud.com/1/vehicles/123/displayparams/248.json?app_instance_id={APP_INSTANCE_ID}"

Vehicle Maintanance Type Object

Attributes

  • idNumberRequiredReadonly
  • nameStringName of a vehicle maintanance type

Vehicle Maintanance object example

{
    "id": 247,
    "name": "Registration"
}

List all vehicle maintenance types

GEThttps://api.giscloud.com/1/maintenance_types.json

Responses

Code Description
200 Operation successful

Example Request

curl -H "API-Key: {USER_API_KEY}" https://api.giscloud.com/1/maintenance_types.json?app_instance_id={APP_INSTANCE_ID}

Example Response

{
   "type": "maintenance_types",
   "total": 14,
   "page": 1,
   "data": [
      {
         "id": 1,
         "name": "Registration"
      },
      {
         "id": 2,
         "name": "Service"
      },
      // ...
   ]
}

Retrieve a vehicle maintenance type

GEThttps://api.giscloud.com/1/maintenance_types/{MAINTENANCE_TYPE_ID}.json

Retrieve a vehicle maintenance type

Responses

Code Description
200 Operation successful

Example request

curl -H "API-Key: {USER_API_KEY}" https://api.giscloud.com/1/maintenance_types/456.json?app_instance_id={APP_INSTANCE_ID}

Example response

{
    "id": 1,
    "name": "Registration"
}

Update a vehicle maintenance type

PUThttps://api.giscloud.com/1/maintenance_types/{MAINTENANCE_TYPE_ID}.json

Update a vehicle maintenance type.

Responses

Code Description
204 Operation successful
403 Action forbidden
404 Resource not found

Example request

curl -H "API-Key: {USER_API_KEY}" -X PUT -d {"name": "Registration"} https://api.giscloud.com/1/maintenance_types/456.json?app_instance_id={APP_INSTANCE_ID}

Delete a vehicle maintenance type

DELETEhttps://api.giscloud.com/1/maintenance_types/{MAINTENANCE_TYPE_ID}.json

Responses

Code Description
204 Operation successful
403 Action forbidden
404 Resource not found

Example Request

curl -H "API-Key: {USER_API_KEY}" -X DELETE https://api.giscloud.com/1/maintenance_types/456.json?app_instance_id={APP_INSTANCE_ID}

Vehicle Maintanance Object

Attributes

  • idNumberRequiredReadonlyVehicle Maintanance ID
  • type_idNumberRequiredVehicle maintenance type ID, from request /rest/1/maintenance_types.json
  • dateDateDate in format e.g. "2019-12-11"
  • odometerNumberValue of odometer
  • date_intervalStringRecurring interval in ISO 8601 Durations format, e.g. "P1Y" = Year, "P6M" = 6 months, "P1M" = 1 month
  • odometer_intervalNumberOdometer interval

Vehicle Maintanance object example

{
    "id": 23,
    "type_id": 1,
    "date": "2019-12-12",
    "odometer": 432,
    "date_interval": "P1Y",
    "odometer_interval": 500
}

List all vehicle maintenance parameters

GEThttps://api.giscloud.com/1/vehicle/{VEHICLE_ID}/maintenance.json

Responses

Code Description
200 Operation successful

Example Request

curl -H "API-Key: {USER_API_KEY}" https://api.giscloud.com/1/vehicle/456/maintenance.json?app_instance_id={APP_INSTANCE_ID}

Example Response

{
   "type": "maintenances",
   "total": 14,
   "page": 1,
   "data": [
      {
        "id": 22,
        "type_id": 15,
        "date": "2019-10-03",
        "odometer": 2222,
        "date_interval": null,
        "odometer_interval": null
    },
    {
        "id": 23,
        "type_id": 1,
        "date": "2019-12-12",
        "odometer": 432,
        "date_interval": "P1Y",
        "odometer_interval": 500
    }
    // ...
   ]
}

Retrieve a vehicle maintenance parameter

GEThttps://api.giscloud.com/1/vehicles/{VEHICLE_ID}/maintenance/{MAINTENANCE_ID}.json

Retrieve a vehicle maintenance parameter.

Responses

Code Description
200 Operation successful

Example request

curl -H "API-Key: {USER_API_KEY}" https://api.giscloud.com/1/vehicles/456/maintenance/1.json?app_instance_id={APP_INSTANCE_ID}

Example response

{
    "id": 23,
    "type_id": 1,
    "date": "2019-12-12",
    "odometer": 432,
    "date_interval": "P1Y",
    "odometer_interval": 500
}

Create new vehicle maintanence parameter

POSThttps://api.giscloud.com/1/vehicles/{VEHICLE_ID}/maintenance.json

Responses

Code Description
201 Operation successful
403 Action forbidden
404 Resource not found

Example Request

curl -H "API-Key: {USER_API_KEY}" -X POST -d '{"type_id": 14, "date": "2020-10-03", "odometer": 3333, "date_interval": "P1Y", "odometer_interval": 500}' https://api.giscloud.com/1/vehicles/123/odometer.json?app_instance_id={APP_INSTANCE_ID}

Update a vehicle maintenance parameter

PUThttps://api.giscloud.com/1/vehicles/{VEHICLE_ID}/maintenance/{MAINTENANCE_ID}.json

Update a vehicle maintenance type.

Responses

Code Description
204 Operation successful
403 Action forbidden
404 Resource not found

Example request

curl -H "API-Key: {USER_API_KEY}" -X PUT -d {"name": "Registration"} https://api.giscloud.com/1/vehicles/456/maintenance/1.json?app_instance_id={APP_INSTANCE_ID}

Delete a vehicle maintenance parameter

DELETEhttps://api.giscloud.com/1/vehicles/{VEHICLE_ID}/maintenance/{MAINTENANCE_ID}.json

Responses

Code Description
204 Operation successful
403 Action forbidden
404 Resource not found

Example Request

curl -H "API-Key: {USER_API_KEY}" -X DELETE https://api.giscloud.com/1/vehicles/123/maintenance/456.json?app_instance_id={APP_INSTANCE_ID}

Odometer Object

Attributes

  • idNumberRequiredReadonlyID
  • valueNumberOdometer value
  • timestampNumberTime of the reading (UNIX timestamp)

Odometer object example

{
    "id": 7,
    "value": 100,
    "timestamp": 1565271356
}

List all odometer readings for a vehicle

GEThttps://api.giscloud.com/1/vehicles/{VEHICLE_ID}/odometer.json

Responses

Code Description
200 Operation successful

Example Request

curl -H "API-Key: {USER_API_KEY}" https://api.giscloud.com/1/vehicles/{VEHICLE_ID}/odometer.json?app_instance_id={APP_INSTANCE_ID}

Example Response

{
   "type": "odometer_readings",
   "total": 10,
   "page": 1,
   "data": [
      {
         "id": 1,
         "valu": 200,
         "timestamp": 1594635292
      },
      {
         "id": 2,
         "value": 250,
         "name": 1582755465
      },
      // ...
   ]
}

Send new vehicle odometer reading

POSThttps://api.giscloud.com/1/vehicles/{VEHICLE_ID}/odometer.json

Responses

Code Description
201 Operation successful
403 Action forbidden
404 Resource not found

Example Request

curl -H "API-Key: {USER_API_KEY}" -X POST -d '{"value": 100, "timestamp": 1582755465}' https://api.giscloud.com/1/vehicles/123/odometer.json?app_instance_id={APP_INSTANCE_ID}

Update a vehicle odometer reading

Not supported. If you need to update wrong odometer reading you need to delete it first and then send new one.

Delete a vehicle odometer reading

DELETEhttps://api.giscloud.com/1/vehicles/{VEHICLE_ID}/odometer/{ODOMETER_ID}.json

Responses

Code Description
204 Operation successful
403 Action forbidden
404 Resource not found

Example Request

curl -H "API-Key: {USER_API_KEY}" -X DELETE https://api.giscloud.com/1/vehicles/456/odometer/1.json?app_instance_id={APP_INSTANCE_ID}

Vehicle Fuel Reading Object

Attributes

  • idNumberRequiredReadonlyVehicle Fuel Reading ID
  • odometerNumberOdometer value
  • fuel_in_litresNumberFuel in litres
  • timestampNumberTime of the reading (UNIX timestamp)
  • total_kmNumberTotal kilometers
  • avg_fuel_usageNumberReadonlyAverage fuel usage

Vehicle Fuel Reading object example

{
    "id": 14,
    "odometer": 20000,
    "fuel_in_litres": 50,
    "timestamp": 1582755465,
    "total_km": 22000,
    "avg_fuel_usage": 40.650406504065
}

List all fuel readings for a vehicle

GEThttps://api.giscloud.com/1/vehicles/{VEHICLE_ID}/fuelreadings.json

Responses

Code Description
200 Operation successful

Example Request

curl -H "API-Key: {USER_API_KEY}" https://api.giscloud.com/1/vehicles/{VEHICLE_ID}/fuelreadings.json?app_instance_id={APP_INSTANCE_ID}

Example Response

{
   "type": "fuel_readings",
   "total": 10,
   "page": 1,
   "data": [
      {
        "id": 14,
        "odometer": 20000,
        "fuel_in_litres": 50,
        "timestamp": 1582755465,
        "total_km": 22000,
        "avg_fuel_usage": 10.650406504065
      },
    {
        "id": 15,
        "odometer": 20500,
        "fuel_in_litres": 52,
        "timestamp": 1582756465,
        "total_km": 22500,
        "avg_fuel_usage": 11.650406504065
    }
    // ...
   ]
}

Send new vehicle fuel reading

POSThttps://api.giscloud.com/1/vehicles/{VEHICLE_ID}/fuelreadings.json

Responses

Code Description
201 Operation successful
403 Action forbidden
404 Resource not found

Example Request

curl -H "API-Key: {USER_API_KEY}" -X POST -d '{"odometer": 1000, "fuel_in_litres": 10, "timestamp": 1582755465}' https://api.giscloud.com/1/vehicles/123/odometer.json?app_instance_id={APP_INSTANCE_ID}

Update a vehicle fuel reading

Not supported. If you need to update wrong fuel reading you need to delete it first and then send new one.

Delete a vehicle fuel reading

DELETEhttps://api.giscloud.com/1/vehicles/{VEHICLE_ID}/fuelreadings/{FUEL_READING_ID}.json

Example Request

curl -H "API-Key: {USER_API_KEY}" -X DELETE https://api.giscloud.com/1/vehicles/456/fuelreadings/1.json?app_instance_id={APP_INSTANCE_ID}

Export all fuel readings for a vehicle

GEThttps://api.giscloud.com/1/vehicles/{VEHICLE_ID}/fuelreadings/export

Responses

XLS file with all fuel readings for a vehicle

Responses

Code Description
204 Operation successful
403 Action forbidden
404 Resource not found

Example Request

curl -H "API-Key: {USER_API_KEY}" https://api.giscloud.com/1/vehicles/{VEHICLE_ID}/fuelreadings/export?app_instance_id={APP_INSTANCE_ID}

Calibrate a fuel tank on the vehicle

PUThttps://api.giscloud.com/1/vehicles/{VEHICLE_ID}/fuelcalibrate.json

Responses

Code Description
204 Operation successful
403 Action forbidden
404 Resource not found

Example request

curl -H "API-Key: {USER_API_KEY}" -X PUT -d '{"sensor_param": 9, "x_readings": [10,20,30,40,50], "fx_readings": [9, 19, 29, 39, 49], "refuel_min_levl": 13, "refuel_min_perc": 16 }' https://api.giscloud.com/1/vehicles/456/fuelcalibrate.json?app_instance_id={APP_INSTANCE_ID}

Reset fuel tank calibration on the vehicle

DELETEhttps://api.giscloud.com/1/vehicles/{VEHICLE_LABEL_ID}/fuelcalibrate.json

Responses

Code Description
204 Operation successful
403 Action forbidden
404 Resource not found

Example Request

curl -H "API-Key: {USER_API_KEY}" -X DELETE https://api.giscloud.com/1/vehicles/{VEHICLE_LABEL_ID}/fuelcalibrate.json?app_instance_id={APP_INSTANCE_ID}

Track Layers

There are two types of Track Layers.

  1. Created inside Track app
  2. Created from existing GIS Cloud layers/datasource (managed inside GIS Cloud Editor app)

The Track Layer Object

Attributes

  • idNumberRequiredReadonlyTrack Layer ID
  • nameStringRequiredName of a track layer
  • descriptionStringDescription of a track layer
  • bufferNumberRequiredBuffer distance (in meter)
  • colorStringColor of a track layer
  • giscloud_layerBooleanReadonlyGIS Cloud layer
  • datasource_idNumberReadonlyDatasource ID (if giscloud_layer=true)
  • table_nameStringReadonlyTable name of POI datasource (if giscloud_layer=true)
  • description_fieldStringDescription field of a datasource
  • address_fieldStringAddress field of a datasource

Track Layer object

{
    "id": 456,
    "name": "Shops",
    "description": "List of all shops",
    "default_buffer": 100,
    "color": "#fccb00",
    "giscloud_layer": true,
    "table_name": "poi_table",
    "datasource_id": 12345,
    "description_field": "description",
    "address_field": "address"
}

List all Track layers

GEThttps://api.giscloud.com/1/tracklayers.json

Get list of all track layers on the current Track app instance.

Query Parameters

Attribute name Description
app_instance_id App instance ID

Responses

Code Description
200 Operation successful

Example request

curl -H "API-Key: {USER_API_KEY}" https://api.giscloud.com/1/tracklayers.json?app_instance_id={APP_INSTANCE_ID}

Example response

{    
"type": "tracklayers",
"total": 2,
"page": 1,
"data": [
   {
    "id": 456,
    "name": "Shops",
    "description": "List of all shops",
    "default_buffer": 100,
    "color": "#fccb00",
    "datasource_id": 849905,
    "giscloud_layer": false
   },
   {
    "id": 457,
    "name": "Factories",
    "description": "",
    "default_buffer": 200,
    "color": "#fF0000",
    "giscloud_layer": true,
    "table_name": "poi_table",
    "datasource_id": 849906,
    "description_field": "description",
    "address_field": "address"
   }
  ]
}

Retrieve a Track layer

GEThttps://api.giscloud.com/1/tracklayers/{TRACK_LAYER_ID}.json

Get the single Track layer data

Responses

Code Description
200 Operation successful

Example request

curl -H "API-Key: {USER_API_KEY}" https://api.giscloud.com/1/tracklayers/456.json?app_instance_id={APP_INSTANCE_ID}

Example response

{    
    "id": 457,
    "name": "Factories",
    "description": "",
    "default_buffer": 200,
    "color": "#fF0000",
    "datasource_id": 849906,
    "giscloud_layer": false
}

Create new Track layer

POSThttps://api.giscloud.com/1/tracklayers.json

Responses

Code Description
201 Operation successful
403 Action forbidden
404 Resource not found

Example Request

curl -H "API-Key: {USER_API_KEY}" -X POST -d '{"name": "POI Group", "description": "About POI group", "color": "0xff0000", "default_buffer": 300}' https://api.giscloud.com/1/tracklayers.json?app_instance_id={APP_INSTANCE_ID}

Example Request: for existing table

curl -H "API-Key: {USER_API_KEY}" -X POST -d '{"name": "POI Group", "description": "About POI group", "color": "0xff0000", "default_buffer": 300, "table_name": "my_poi_table", "description_field": "description", "address_field": "address"}' https://api.giscloud.com/1/tracklayers.json?app_instance_id={APP_INSTANCE_ID}

Update a Track layer

PUThttps://api.giscloud.com/1/tracklayers/{TRACK_LAYER_ID}.json

Update Track layer properties.

Responses

Code Description
204 Operation successful
403 Action forbidden
404 Resource not found

Example request

curl -H "API-Key: {USER_API_KEY}" -X PUT -d {"name": "New layer name"} https://api.giscloud.com/1/tracklayers/456.json?app_instance_id={APP_INSTANCE_ID}

Delete a Track layer

DELETEhttps://api.giscloud.com/1/tracklayers/{TRACK_LAYER_ID}.json

Responses

Code Description
204 Operation successful
403 Action forbidden
404 Resource not found

Example Request

curl -H "API-Key: {USER_API_KEY}" -X DELETE https://api.giscloud.com/1/tracklayers/{TRACK_LAYER_ID}.json?app_instance_id={APP_INSTANCE_ID}

The Track Layer Feature Object (POI)

Attributes

  • idNumberRequiredReadonlyTrack Layer Feature ID
  • descriptionStringDescription of a Track layer feature
  • addressStringDescription of a track layer feature
  • bufferNumberBuffer distance (in meter)
  • geometryGeometryRequiredFeature geometry (WKT format)
  • geometry_bufferGeometryReadonlyFeature geometry with buffer

Track Layer Feature object

{
    "id": 2,
    "description": "Simple Polygon",
    "address": null,
    "buffer": 0,
    "geometry": "POLYGON((15.9396600723266 45.7966735069261,15.9440374374389 45.796583744254,15.9436511993408 45.7950278349647,15.9400033950805 45.7952073651767,15.9396600723266 45.7966735069261))",
    "geometry_buffer": "POLYGON((15.9396600723266 45.7966735069261,15.9440374374389 45.796583744254,15.9436511993408 45.7950278349647,15.9400033950805 45.7952073651767,15.9396600723266 45.7966735069261))"
}

List all Track layer features

GEThttps://api.giscloud.com/1/tracklayers/{TRACK_FEATURE_ID}/features.json

Get list of all track layer features.

Query Parameters

Attribute name Description
app_instance_id App instance ID

Responses

Code Description
200 Operation successful

Example request

curl -H "API-Key: {USER_API_KEY}" https://api.giscloud.com/1/tracklayers/{TRACK_FEATURE_ID}/features.json?app_instance_id={APP_INSTANCE_ID}

Example response

{    
"type": "tracklayerfeatures",
"total": 2,
"page": 1,
"data": [
   {
    "id": 1,
    "description": "Simple Polygon",
    "address": null,
    "buffer": 0,
    "geometry": "POLYGON((15.9396600723266 45.7966735069261,15.9440374374389 45.796583744254,15.9436511993408 45.7950278349647,15.9400033950805 45.7952073651767,15.9396600723266 45.7966735069261))",
    "geometry_buffer": "POLYGON((15.9396600723266 45.7966735069261,15.9440374374389 45.796583744254,15.9436511993408 45.7950278349647,15.9400033950805 45.7952073651767,15.9396600723266 45.7966735069261))"
  },
  {
    "id": 2,
    "description": "Point",
    "address": "Ilica 13, Zagreb, Croatia",
    "buffer": 0,
    "geometry": "POINT(15.9386730194091 45.7932025783118)",
    "geometry_buffer": "POLYGON((15.9400204923353 45.7932025783118, ..."
  }
  ]
}

Retrieve a feature

GEThttps://api.giscloud.com/1/tracklayers/{TRACK_LAYER_ID}/features/{FEATURE_ID}.json

Get the single Track layer data

Responses

Code Description
200 Operation successful

Example request

curl -H "API-Key: {USER_API_KEY}" https://api.giscloud.com/1/tracklayers/456/features/1.json?app_instance_id={APP_INSTANCE_ID}

Example response

{    
  {
    "id": 1,
    "description": "Simple Polygon",
    "address": null,
    "buffer": 0,
    "geometry": "POLYGON((15.9396600723266 45.7966735069261,15.9440374374389 45.796583744254,15.9436511993408 45.7950278349647,15.9400033950805 45.7952073651767,15.9396600723266 45.7966735069261))",
    "geometry_buffer": "POLYGON((15.9396600723266 45.7966735069261,15.9440374374389 45.796583744254,15.9436511993408 45.7950278349647,15.9400033950805 45.7952073651767,15.9396600723266 45.7966735069261))"
  }
}

Update a feature

PUThttps://api.giscloud.com/1/tracklayers/{TRACK_LAYER_ID}/features/{FEATURE_ID}.json

Update Track layer feature properties.

Responses

Code Description
204 Operation successful
403 Action forbidden
404 Resource not found

Example request

curl -H "API-Key: {USER_API_KEY}" -X PUT -d {"description": "here goes any description"} https://api.giscloud.com/1/tracklayers/456/features/1.json?app_instance_id={APP_INSTANCE_ID}

Delete a Track layer

DELETEhttps://api.giscloud.com/1/tracklayers/{TRACK_LAYER_ID}/features/{FEATURE_ID}.json

Responses

Code Description
204 Operation successful
403 Action forbidden
404 Resource not found

Example Request

curl -H "API-Key: {USER_API_KEY}" -X DELETE https://api.giscloud.com/1/tracklayers/{TRACK_LAYER_ID}/features/1.json?app_instance_id={APP_INSTANCE_ID}

The Alert Object

Attributes

  • idNumberRequiredReadonlyAlert ID
  • typeStringAlert type, possible values: speeding, poi, service, fuel-drop, gc_sen, ungeared and date_odo.
  • nameStringAlert name
  • refresh_intervalNumberAlert refresh interval (in minutes)
  • refresh_wait_intervalNumberAlert refresh wait interval (in minutes)
  • paramsAlertParamsObjectAlert parameters
  • refresh_countNumberReadonlyRefresh count ??
  • last_refresh_timeDateReadonly??
  • seenBooleanReadonlyHas alert been seen by the user
  • messagesArrayReadonlyHas alert been seen by the user

Alert type

Description Alert Type
Speeding alert speeding
POI alert poi
Service alert service
Fuel drop fuel-drop
Generic sensor gc_sen
Ungeared ungeared
Maintenance (date/odometer) date_odo
No driver no_driver

Parameter 'refresh_interval'

Value Description
60 Every minute
300 Every 5 minutes
900 Every 15 minutes
1800 Every 30 minutes
3600 Every hour
14400 Every 4 hours
28800 Every 8 hours
86400 Once a day

Parameter 'refresh_wait_interval'

Value Description
0 No wait
300 5 minutes wait
600 10 minutes wait
900 15 minutes wait
1800 30 minutes wait
3600 One hour wait
28800 Eight hours wait

Alert object

{
    "id": 62,
    "type": "speeding",
    "name": "Speeding alert",
    "refresh_interval": 900,
    "refresh_wait_interval": 900,
    "params": {
        "speed_limit": 80,
        "label": null,
        "vehicle": -1
    },
    "refresh_count": 0,
    "last_refresh_time": null,
    "seen": true,
    "messages": [],
    "email": null,
    "status": 1
}

List all alerts

GEThttps://api.giscloud.com/1/alerts.json

Get list of all alerts.

Query Parameters

Attribute name Description
app_instance_id App instance ID

Responses

Code Description
200 Operation successful

Example request

curl -H "API-Key: {USER_API_KEY}" https://api.giscloud.com/1/alerts.json?app_instance_id={APP_INSTANCE_ID}

Example response

{
   "type":"alerts",
   "total":2,
   "page":1,
   "data":[
      {
         "id":62,
         "type":"speeding",
         "name":"Speeding alert",
         "refresh_interval":900,
         "refresh_wait_interval":900,
         "params":{
            "speed_limit":80,
            "label":null,
            "vehicle":-1
         },
         "refresh_count":0,
         "last_refresh_time":null,
         "seen":true,
         "messages":[
            
         ],
         "email":null,
         "status":1
      },
      {
         "id":60,
         "type":"date_odo",
         "name":"service ",
         "refresh_interval":14400,
         "refresh_wait_interval":0,
         "params":{
            "alert_before_date":"12",
            "alert_before_odo":"10000",
            "maintenance_type_id":"10",
            "label":null,
            "vehicle":-1
         },
         "refresh_count":703,
         "last_refresh_time":"2020-09-12 17:20:01.539216+00",
         "seen":true,
         "messages":[
            
         ],
         "email":"",
         "status":1
      }
   ]
}

Retrieve an alert

GEThttps://api.giscloud.com/1/alerts/{ALERT_ID}.json

Get the alert data.

Responses

Code Description
200 Operation successful

Example request

curl -H "API-Key: {USER_API_KEY}" https://api.giscloud.com/1/alerts/1.json?app_instance_id={APP_INSTANCE_ID}

Example response

{
    "id": 62,
    "type": "speeding",
    "name": "Speeding alert",
    "refresh_interval": 900,
    "refresh_wait_interval": 900,
    "params": {
        "speed_limit": 80,
        "label": null,
        "vehicle": -1
    },
    "refresh_count": 0,
    "last_refresh_time": null,
    "seen": true,
    "messages": [],
    "email": null,
    "status": 1
}

Update an alert

PUThttps://api.giscloud.com/1/alerts/{ALERT_ID}.json

Update alert properties.

Important: only following fields can be changed after CREATE: name, refresh_interval, refresh_wait_interval, email, params.vehicle & params.label. At the moment PUT endpoint doesn’t support changing specific fields, entire AlertParamsObject must be sent.

Responses

Code Description
204 Operation successful
403 Action forbidden
404 Resource not found

Example request

curl -H "API-Key: {USER_API_KEY}" -X PUT -d {"name": "Speeding"} https://api.giscloud.com/1/alerts/1.json?app_instance_id={APP_INSTANCE_ID}

Delete an alert

DELETEhttps://api.giscloud.com/1/alerts/{ALERT_ID}.json

Responses

Code Description
204 Operation successful
403 Action forbidden
404 Resource not found

Example Request

curl -H "API-Key: {USER_API_KEY}" -X DELETE https://api.giscloud.com/1/alerts/1.json?app_instance_id={APP_INSTANCE_ID}

The TaskColumn Object

Task columns je endpoint koji vraca popis svih vrsta parametara koji se koriste unutar reporta. Sluzi za populiranje popisa na UI. Za Standard reporte mora se filtrirati po task_type_id==1 i is_default == false.

Attributes

  • idNumberRequiredReadonlyTask Column ID
  • task_type_idNumberReadonlyTask Column type ID
  • is_defaultBooleanReadonlyIs default
  • formatStringReadonlyFormat of the task column
  • mandatory_param_idNumberReadonly
  • column_nameStringReadonly
  • column_orderNumberReadonly
  • expressionStringReadonly
  • descriptionStringReadonly
  • modifierStringReadonly
  • dependsStringReadonly
  • visibilityBooleanReadonly

TaskColumn object

{
    "id": 1,
    "task_type_id": 1,
    "is_default": true,
    "format": "string",
    "mandatory_param_id": 0,
    "column_name": "mark",
    "column_order": "10",
    "expression": "mark",
    "description": "mark",
    "modifier": null,
    "depends": null,
    "visibility": true
}

List all Task Columns

GEThttps://api.giscloud.com/1/taskcolumns.json

Example request

curl -H "API-Key: {USER_API_KEY}" https://api.giscloud.com/1/taskcolumns.json?app_instance_id={APP_INSTANCE_ID}

Example response

{
   "type":"taskcolumnses",
   "total":53,
   "page":1,
   "data":[
      {
         "id":1,
         "task_type_id":1,
         "is_default":true,
         "format":"string",
         "mandatory_param_id":0,
         "column_name":"mark",
         "column_order":"10",
         "expression":"mark",
         "description":"mark",
         "modifier":null,
         "depends":null,
         "visibility":true
      },
      {
         "id":2,
         "task_type_id":1,
         "is_default":true,
         "format":"datetime",
         "mandatory_param_id":0,
         "column_name":"start_t",
         "column_order":"30",
         "expression":"start_t",
         "description":"start_t",
         "modifier":"MIN",
         "depends":null,
         "visibility":true
      },
      // ...
   ]
}

Retrieve a Task Column

GEThttps://api.giscloud.com/1/taskcolumns/{TASK_COLUMN_ID}.json

Example request

curl -H "API-Key: {USER_API_KEY}" https://api.giscloud.com/1/taskcolumns/1.json?app_instance_id={APP_INSTANCE_ID}

Example response

{
    "id": 1,
    "task_type_id": 1,
    "is_default": true,
    "format": "string",
    "mandatory_param_id": 0,
    "column_name": "mark",
    "column_order": "10",
    "expression": "mark",
    "description": "mark",
    "modifier": null,
    "depends": null,
    "visibility": true
}

The ReportTemplate Object

Attributes

  • idNumberRequiredReadonlyReport template ID
  • nameNumberRequiredReport template name
  • paramsReportTemplateParamsObjectRequiredList of column IDs

ReportTemplate object

{
    "id": 27,
    "name": "Report template #1",
    "params": {
        "columns": [6,7]
    }
}

List all Report templates

GEThttps://api.giscloud.com/1/reporttemplates.json

Example request

curl -H "API-Key: {USER_API_KEY}" https://api.giscloud.com/1/reporttemplates.json?app_instance_id={APP_INSTANCE_ID}

Example response

{
   "type": "reporttemplates",
   "total": 3,
   "page": 1,
   "data": [
      {
         "id": 27,
         "name": "Report template #1",
         "params": {
            "columns":[6,7]
         }
      },
      {
         "id": 29,
         "name": "Report template #2",
         "params": {
            "columns":[10, 11, 8]
         }
      },
      {
         "id": 34,
         "name": "A1",
         "params": {
            "columns":[11]
         }
      }
   ]
}

Retrieve a Report template

GEThttps://api.giscloud.com/1/reporttemplates/{REPORT_TEMPLATE_ID}.json

Example request

curl -H "API-Key: {USER_API_KEY}" https://api.giscloud.com/1/reporttemplates/1.json?app_instance_id={APP_INSTANCE_ID}

Example response

{
    "id": 27,
    "name": "Report template #1",
    "params": {
        "columns": [6,7]
    }
}

Update a Report template

PUThttps://api.giscloud.com/1/reporttemplates/{REPORT_TEMPLATE_ID}.json

Update report template properties.

Responses

Code Description
204 Operation successful
403 Action forbidden
404 Resource not found

Example request

curl -H "API-Key: {USER_API_KEY}" -X PUT -d {"name": "New report template name"} https://api.giscloud.com/1/reporttemplates/456.json?app_instance_id={APP_INSTANCE_ID}

Delete a Report template

DELETEhttps://api.giscloud.com/1/reporttemplates/{REPORT_TEMPLATE_ID}.json

Responses

Code Description
204 Operation successful
403 Action forbidden
404 Resource not found

Example Request

curl -H "API-Key: {USER_API_KEY}" -X DELETE https://api.giscloud.com/1/reporttemplates/{REPORT_TEMPLATE_ID}.json?app_instance_id={APP_INSTANCE_ID}

The Report object

Attributes

  • req_idNumberRequiredReadonlyReport ID
  • requestedNumberReadonly
  • processedNumberReadonly
  • taskTypeStringReport type, possible values are: 'geotrag_report', 'geotrag_poi_report', 'geotrag_status_report' and 'geotrag_driver_status_report'.
  • statusStringReadonlyPossible values are: 'finished', 'error' and 'pending'.
  • paramsReportParamsObjectExpandableReport parameters object

Example Report object

{
    "req_id": 284734,
    "requested": 1600204588,
    "processed": "",
    "status": "pending",
    "taskType": "geotrag_report",
    "params": {
        "vehicle_id":"-1",
        "time_limits_start":"1600120800",
        "time_limits_end":"1600207200",
        "column_model":"{\"max_speed\":{\"title\":\"Maximum speed\",\"expression\":\"GREATEST(wheel_speed, speed)\",\"modifier\":\"MAX\",\"format\":\"decimal\",\"order\":\"110\"},\"total_time\":{\"title\":\"Drive time\",\"expression\":\"duration >= 0\",\"modifier\":\"SUM\",\"format\":\"period\",\"order\":\"50\"},\"length_m\":{\"title\":\"Length (m)\",\"expression\":\"length_m\",\"modifier\":\"SUM\",\"format\":\"decimal\",\"order\":\"60\"},\"length_km\":{\"title\":\"Length (Km)\",\"expression\":\"length_km\",\"modifier\":\"SUM\",\"format\":\"decimal\",\"order\":\"70\"},\"mark\":{\"title\":\"Vehicle mark\",\"format\":\"string\",\"order\":\"10\",\"modifier\":null,\"expression\":\"mark\"},\"start_t\":{\"title\":\"Start (time)\",\"format\":\"datetime\",\"order\":\"30\",\"modifier\":\"MIN\",\"expression\":\"start_t\"},\"stop_t\":{\"title\":\"Stop (time)\",\"format\":\"datetime\",\"order\":\"40\",\"modifier\":\"MAX\",\"expression\":\"stop_t\"}}",
        "send_email":"1"
    }
}

List all reports

GEThttps://api.giscloud.com/1/reports.json

Example request

curl -H "API-Key: {USER_API_KEY}" https://api.giscloud.com/1/reports.json?app_instance_id={APP_INSTANCE_ID}

Example response

{
   "type":"task_lists",
   "total":5,
   "page":1,
   "data":[
      {
         "req_id":"284734",
         "scheduled":null,
         "requested":1600204588,
         "processed":"",
         "status":"pending",
         "taskType":"geotrag_report",
         "params":{
            "vehicle_id":"-1",
            "time_limits_start":"1600120800",
            "time_limits_end":"1600207200",
            "column_model":"{\"max_speed\":{\"title\":\"Maximum speed\",\"expression\":\"GREATEST(wheel_speed, speed)\",\"modifier\":\"MAX\",\"format\":\"decimal\",\"order\":\"110\"},\"total_time\":{\"title\":\"Drive time\",\"expression\":\"duration >= 0\",\"modifier\":\"SUM\",\"format\":\"period\",\"order\":\"50\"},\"length_m\":{\"title\":\"Length (m)\",\"expression\":\"length_m\",\"modifier\":\"SUM\",\"format\":\"decimal\",\"order\":\"60\"},\"length_km\":{\"title\":\"Length (Km)\",\"expression\":\"length_km\",\"modifier\":\"SUM\",\"format\":\"decimal\",\"order\":\"70\"},\"mark\":{\"title\":\"Vehicle mark\",\"format\":\"string\",\"order\":\"10\",\"modifier\":null,\"expression\":\"mark\"},\"start_t\":{\"title\":\"Start (time)\",\"format\":\"datetime\",\"order\":\"30\",\"modifier\":\"MIN\",\"expression\":\"start_t\"},\"stop_t\":{\"title\":\"Stop (time)\",\"format\":\"datetime\",\"order\":\"40\",\"modifier\":\"MAX\",\"expression\":\"stop_t\"}}",
            "send_email":"1"
         }
      },
      {
         "req_id":"229081",
         "scheduled":null,
         "requested":1575019880,
         "processed":1575019923,
         "status":"finished",
         "taskType":"geotrag_status_report",
         "params":{
            "vehicle_id":"13",
            "column_model":"[]",
            "send_email":"1"
         }
      },
      {
         "req_id":"229050",
         "scheduled":null,
         "requested":1574987116,
         "processed":1574987161,
         "status":"error",
         "taskType":"geotrag_report",
         "params":[
            
         ]
      },
      {
         "req_id":"206973",
         "scheduled":null,
         "requested":1564216404,
         "processed":1564216441,
         "status":"finished",
         "taskType":"geotrag_driver_status_report",
         "params":{
            "column_model":"[]",
            "send_email":"1"
         }
      }
   ]
}

Retrieve a Report

GEThttps://api.giscloud.com/1/reports/{REPORT_ID}.json

Example request

curl -H "API-Key: {USER_API_KEY}" https://api.giscloud.com/1/reports/1.json?app_instance_id={APP_INSTANCE_ID}

Example response

{
   "request":{
      "id":"284734",
      "user_id":"86",
      "task_type_id":"1",
      "status":null,
      "priority":"500",
      "alternate_email":"marko@giscloud.com",
      "timestamp_requested":"2020-09-15 21:16:28",
      "timestamp_processed":"2020-09-15 21:17:04",
      "timestamp_scheduled":null,
      "time_spent":"3.06455",
      "gc_app_id":"103285"
   },
   "params":{
      "vehicle_id":null,
      "time_limits_start":"1600120800",
      "time_limits_end":"1600207200",
      "column_model":"{\"max_speed\":{\"title\":\"Maximum speed\",\"expression\":\"GREATEST(wheel_speed, speed)\",\"modifier\":\"MAX\",\"format\":\"decimal\",\"order\":\"110\"},\"total_time\":{\"title\":\"Drive time\",\"expression\":\"duration >= 0\",\"modifier\":\"SUM\",\"format\":\"period\",\"order\":\"50\"},\"length_m\":{\"title\":\"Length (m)\",\"expression\":\"length_m\",\"modifier\":\"SUM\",\"format\":\"decimal\",\"order\":\"60\"},\"length_km\":{\"title\":\"Length (Km)\",\"expression\":\"length_km\",\"modifier\":\"SUM\",\"format\":\"decimal\",\"order\":\"70\"},\"mark\":{\"title\":\"Vehicle mark\",\"format\":\"string\",\"order\":\"10\",\"modifier\":null,\"expression\":\"mark\"},\"start_t\":{\"title\":\"Start (time)\",\"format\":\"datetime\",\"order\":\"30\",\"modifier\":\"MIN\",\"expression\":\"start_t\"},\"stop_t\":{\"title\":\"Stop (time)\",\"format\":\"datetime\",\"order\":\"40\",\"modifier\":\"MAX\",\"expression\":\"stop_t\"}}",
      "send_email":"1",
      "alternate_email": "trackadmin@giscloud.com"
   }
}

Create new report

POSThttps://api.giscloud.com/1/reports.json

Field: report_type

Value Report type
1 Standard report
4 POI Report
300 Driver Status report
500 Vehicle status report

Field: params

Report Param Name Type Description
vehicle_id Int Za sva vozila stavlja se vrijednost -1
label_id Int
driver_id Int
only_summary 1 or 0
alternative_report_name String
time_limits_start Timestamp
time_limits_end Timestamp
days_of_week String e.g. “2,3,4,5,6,0” svi osim pon (1)
time_of_day_start Int e.g. value 644 za 10:44, value 28 za 00:28. Znaci broj minuta od ponoci
time_of_day_end Int e.g. value 824 za 11:44, value 1439 za 23:59. Znaci broj minuta od ponoci
poi_layer_id Int
send_email 1 or 0
column_model Object {<task_column_name>: TaskColumnObject}

Responses

Code Description
201 Operation successful
403 Action forbidden
404 Resource not found

Column model example

Object params.column_model needs to be generated from following REST API interface /rest/1/taskcolumns/{TASK_COLUMN_ID}.json.

GET /rest/1/taskcolumns/4.json

Taskcolumn Object
{
    "id": 4,
    "task_type_id": 1,
    "is_default": false,
    "format": "decimal",
    "mandatory_param_id": null,
    "column_name": "max_speed",
    "column_order": "110",
    "expression": "GREATEST(wheel_speed, speed)",
    "description": "max_speed",
    "modifier": "MAX",
    "depends": null,
    "visibility": true
}

===> 

params.column_model with structure:

"max_speed": {
    "title": "Maximum speed", // i18n, key is taskcolumn.column_name, e.g. max_speed
    "expression": "GREATEST(wheel_speed, speed)", // taskcolumn.expression
    "modifier": "MAX", // taskcolumn.modifier
    "format": "decimal", // taskcolumn.format
    "order": "110" // taskcolumn.column_order
}

Example Request: New Standard Report

curl -H "API-Key: {USER_API_KEY}" -X POST -d '{"report_type":1,"params":"{\"vehicle_id\":\"13\",\"time_limits_start\":1600293600,\"time_limits_end\":1600380000,\"speed_limit\":\"50\",\"send_email\":1,\"column_model\":{\"max_speed\":{\"title\":\"Maximum speed\",\"expression\":\"GREATEST(wheel_speed, speed)\",\"modifier\":\"MAX\",\"format\":\"decimal\",\"order\":\"110\"},\"length_km\":{\"title\":\"Length (Km)\",\"expression\":\"length_km\",\"modifier\":\"SUM\",\"format\":\"decimal\",\"order\":\"70\"},\"speed_limit\":{\"title\":\"Drive over speed limit > 50\",\"expression\":\"speed>50\",\"modifier\":\"SUM\",\"format\":\"period\",\"order\":\"120\"},\"total_time\":{\"title\":\"Drive time\",\"expression\":\"duration >= 0\",\"modifier\":\"SUM\",\"format\":\"period\",\"order\":\"50\"}}}"}' https://api.giscloud.com/1/reports.json?app_instance_id={APP_INSTANCE_ID}

Example: New POI Report

curl -H "API-Key: {USER_API_KEY}" -X POST -d '{"report_type": 500, "params": "{\"vehicle_id\": 13, \"time_limits_start\": 1600128000, \"time_limits_end\": 1600214340, \"poi_layer_id\": 58, \"send_email\": 1}"}' https://api.giscloud.com/1/reports.json?app_instance_id={APP_INSTANCE_ID}

Example: New Vehicle Status Report

curl -H "API-Key: {USER_API_KEY}" -X POST -d '{"report_type": 500, "params": "{\"vehicle_id\": -1, \"send_email\": 1}"}' https://api.giscloud.com/1/reports.json?app_instance_id={APP_INSTANCE_ID}

Example: New Drivers Status Report

curl -H "API-Key: {USER_API_KEY}" -X POST -d '{"report_type": 300, "params": "{\"send_email\": 1}"}' https://api.giscloud.com/1/reports.json?app_instance_id={APP_INSTANCE_ID}

Delete a Report

DELETEhttps://api.giscloud.com/1/reports/{REPORT_ID}.json

Responses

Code Description
204 Operation successful
403 Action forbidden
404 Resource not found

Example Request

curl -H "API-Key: {USER_API_KEY}" -X DELETE https://api.giscloud.com/1/reports/{REPORT_ID}.json?app_instance_id={APP_INSTANCE_ID}

Get Report Details

GEThttps://{TRACK_APP_INSTANCE_URL}/reports/request_details/{REPORT_TASK_ID}

Responses

Report Details in HTML view.

Download Report

GEThttps://{TRACK_APP_INSTANCE_URL}/rest/1/rpt_files/report_{REPORT_TASK_ID}.xlsx

Responses

XLSX file.