Events
This method returns selected sensor event list
Request example:
<url_smartroad>/api/<version>/events?login=<login>&password=<password>&sensor_id=<sensor_id>
Extra request parameters
Parameter | Possible parameter | Possible values | Addition | Register sensibility |
---|---|---|---|---|
startDate / endDate | startDate / endDate | Parameters work only in pairs. Setting both start and end of time period is necessary. | ✘ | |
from / to | from / to | 2025-03-14T14:00:00 2025-03-14 14:00:00 | Parameters work only in pairs. Setting both start and end of time period is necessary. | ✘ |
timeZone | timeZone | As values, it's possible to use the full name of time zone or time zone abbreviations. It's allowed to pass only 1 value. | ✘ | |
project_id | project_id | 00112233-4455-6677-8899-aabbccddeeff | It's allowed to pass only 1 value. | ✘ |
sensorId | 00112233-4455-6677-8899-aabbccddeeff | It's allowed to pass more than 1 value. Values are divided by comma with no gaps. | ✘ | |
sensorName | example | It's allowed to pass more than 1 value. When adding multiple sensors in request, it's important for sensors to be from the same project, otherwise request response will be 400 Bad Request. | ✘ | |
interval | interval | The interval parameter is the depth of the time sample in seconds relative to the request time. For example, with a value of 3600, the API returns data for the previous hour. The parameters of start and end of time period has higher priority over interval parameter. The default value is used if the parameter is not specified in the request. Values are count in seconds. It's allowed to pass only 1 value. | ✘ |
Data schema
By receiving a correct request, the System generates a response message in JSON
format.
Response example:
{
"time_zone": "Europe/Moscow",
"message_id": "66ce4647-60fc-1dac-183c-a323807dad78",
"message_data": [
{
"data": [
{
"row": 1,
"val": "39.96",
"code": 456,
"lane": 0,
"type": 1,
"unit": "LOW_SPEED",
"zone": 0,
"level": 0,
"obj_id": 125,
"heading": 180.13,
"point_x": 129.6,
"point_y": -10.2,
"end_time": "2025-04-10T16:43:58.238224+03:00",
"direction": -1,
"events_id": "43475187-e613-4b14-b813-a561a57faad4",
"obj_class": 2,
"obj_speed": 39.96,
"sensor_id": "3a9d31ae-4d9e-469e-99af-a2dca1a333d8",
"close_type": 0,
"obj_length": 8.9,
"start_time": "2025-04-10T16:43:45.845556+03:00",
"description": [
{
"lang": "ru",
"name": "Тормоз"
},
{
"lang": "en",
"name": "Break"
},
{
"lang": "es",
"name": "Freno"
}
],
"projects_id": "777d9dea-05a8-4a34-92bb-f7c6f1726882",
"measure_line": null
}
],
"name": "144.A4.DT1",
"connected": "true",
"sensor_id": "3a9d31ae-4d9e-469e-99af-a2dca1a333d8",
"lane_direction": [
1,
1,
1,
0,
0,
0
]
}
],
"protocol_version": "1.0"
}
events
Json response data schema
Response parameter | Response data type | Parameter definition |
---|---|---|
time_zone | string | Timezone from user profile |
message_id | string (format: uuid) | Message unique identifier |
message_data | array | Message body |
protocol_version | string | API version |
data | array | List of events data separated by selected time period |
name | string | Sensor name |
connected | string | Connected sensor status |
direction | string | Sensor direction |
sensor_id | string | Sensor unique identifier |
lane_direction | array of whole numbers | List of all lanes directions |
row | whole number | Row number from the selected sensor's event list, sorted by the start_time |
val | number | Event parameter value |
code | whole number | Event code |
lane | whole number | Lane number |
type | whole number | Event type |
unit | string | Unit of measurement |
zone | whole number | Index of the zone an object should pass to become a PVR |
level | whole number | Event category |
obj_id | whole number | Object unique identifier. Sensors are tracking detected objects, setting an id for each one since the object enters the scope and till it's exit. The pull of ID numbers is rotating cyclically |
heading | number | Traffic flow direction (movement angle, degrees) |
point_x | number | Distance in meters by X |
point_y | number | Distance in meters by Y |
end_time | string (format: date-time) | The end of event |
direction | whole number | Lane direction |
events_id | string (format: uuid) | Event unique identifier |
obj_class | whole number | Object class number by user-defined classification |
obj_speed | number | Object speed, km/h |
sensor_id | string (format: uuid) | Sensor unique identifier |
close_type | whole number, null | Event closure type |
obj_length | number | Object length, meters. Is used for object class detection |
start_time | string (format: date-time) | The end of event |
description | array | Event name on all accessible languages |
lang | string | Languages |
name | string | Event name |
projects_id | string (format: uuid) | Project unique identifier |
measure_line | whole number, null | Always null |
events
response parameters description
Response parameter | Parameters calculations/default values |
---|---|
val | For boolean events – 1, for quantifiable events – matching numeric value. For example, if speeding detected, first received value according to event rule will be written |
code | Event codes are set by the user while the event creation. Event codes updates and changes won't affect already recorded events |
type | 1 – Speed events, 2 – Traffic events, 9 – Others events. It matches the event rules settings in the System |
unit | KMH – kilometer per hour, MPS - meters per second, PEDESTRIAN – a pedestrian detected, PLACE – object is in the scope, STOP – vehicle stop, WWD – wrong direction |
zone | Is created in Road Management section |
level | 0 – Information event, 1 – Warning event, 2 – Critical event. It matches the event rules settings in the System |
obj_class | Classes numeration start with «0». If sensor isn't able to detect vehicle class, then value is «-1» |
close_type | 0 – Auto, 1 – Manual, NULL – Not closed |