×

Vehicle idle time

This API allows you to get information about vehicle idle periods.

How to get data

Request address

To get the data, use the address:  https://<server_address>/api/api.php?

Request method

GET

Request parameters

Parameters can be sent via the query string or in the POST request body:
  • cmd=get_idle — command to retrieve idle periods
  • node — the number of the node where the command should be executed
  • time_start — start of the period (timestamp, unixtime)
  • time_end — end of the period (timestamp, unixtime)
  • imei — IMEI of the monitoring device. If there are multiple devices, separate them with commas: imei=887556,io9987,76573
     

Example API request

https://<server_address>/api/api.php?cmd=get_idle&time_start=16878956&time_end=16878755&imei=887556,io9987,76573&node=1

Example response

{
  "code": 0,
  "data": {
    "2914": [
      {"idle_start": "1641814740", "idle_end": 1641814984},
      {"idle_start": 1641815547, "idle_end": 1641825619},
      {"idle_start": 1641827105, "idle_end": 1641893307},
      {"idle_start": 1641893623, "idle_end": 1641898037}
      // ... other entries ...
    ]
  },
  "message": "success"
}
The API response contains:
  • code — result code: 0 — success, 1 — error
  • data — a dictionary where keys are vehicle identifiers and values are lists of idle periods:
  • idle_start — start time of the idle period (timestamp)
  • idle_end — end time of the idle period (timestamp)
  • message — text message with the result of the request