×

Sensor values

This API retrieves values of discrete sensors (fuel level, temperature, weight, etc.) for a specified period of time.

How to get data

Request address

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

Request method

GET

Request parameters

  • cmd=get_discrete_sensor_data — command to get sensor data
  • imei — object identifier
  • start — start of the period (Unix timestamp)
  • stop — end of the period (Unix timestamp)
  • tag_id — sensor identifier
  • agent_id — agent identifier (optional)
  • node— node number where the command should be executed
Sensor data can only be retrieved for up to 24 hours.
 

Example request

https://<server_address>/api/api.php?cmd=get_discrete_sensor_data&imei=350424062310402&start=1677682645&stop=1677761845&tag_id=1158&node=1
Response
{
  "sensor_data": {
    "966960": {
      "1677682772": {
        "sensor_id": 966960,
        "unixtimestamp": 1677682772,
        "calibrated_value": "95.09",
        "speed": "0"
      },
      "1677682950": {
        "sensor_id": 966960,
        "unixtimestamp": 1677682950,
        "calibrated_value": "94.9",
        "speed": "12"
      }
    }
  }
}
In response to the API request, the following is returned:
  • sensor_id — sensor identifier
  • unixtimestamp — time of the recorded value (Unix timestamp)
  • calibrated_value — calibrated sensor value (e.g., liters of fuel or degrees of temperature)
  • speed — speed of the object at the moment of measurement