Skip to main content

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

ParameterPossible parameterPossible valuesAdditionRegister sensibility
startDate /
endDate
startDate /
endDate
  • 14.03.2025 13:00 / 14.03.2025 14:00
  • It's allowed to pass time with an accuracy of seconds, minutes or hours.
  • Parameters work only in pairs. Setting both start and end of time period is necessary.
    from / tofrom / to
  • 2025-03-14T13:00:00 /
    2025-03-14T14:00:00
  • 2025-03-14 13:00:00 /
    2025-03-14 14:00:00
  • It's allowed to pass time with an accuracy of seconds, minutes or hours.
  • Parameters work only in pairs. Setting both start and end of time period is necessary.
    timeZonetimeZone
  • default: Europe/Moscow
  • UTC
  • Chile/Continental
  • America/Indiana/Knox
  • 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_idproject_id00112233-4455-6677-8899-aabbccddeeffIt's allowed to pass only 1 value.
    sensorId
  • sensorId
  • sensorID
  • sensor_id
  • 00112233-4455-6677-8899-aabbccddeeffIt's allowed to pass more than 1 value. Values are divided by comma with no gaps.
    sensorName
  • sensorName
  • name
  • exampleIt'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.
    intervalinterval
  • default: 300
  • 60
  • 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 parameterResponse data typeParameter definition
    time_zonestringTimezone from user profile
    message_idstring (format: uuid)Message unique identifier
    message_dataarrayMessage body
    protocol_versionstringAPI version
    dataarrayList of events data separated by selected time period
    namestringSensor name
    connectedstringConnected sensor status
    directionstringSensor direction
    sensor_idstringSensor unique identifier
    lane_directionarray of whole numbersList of all lanes directions
    rowwhole numberRow number from the selected sensor's event list, sorted by the start_time
    valnumberEvent parameter value
    codewhole numberEvent code
    lanewhole numberLane number
    typewhole numberEvent type
    unitstringUnit of measurement
    zonewhole numberIndex of the zone an object should pass to become a PVR
    levelwhole numberEvent category
    obj_idwhole numberObject 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
    headingnumberTraffic flow direction (movement angle, degrees)
    point_xnumberDistance in meters by X
    point_ynumberDistance in meters by Y
    end_timestring (format: date-time)The end of event
    directionwhole numberLane direction
    events_idstring (format: uuid)Event unique identifier
    obj_classwhole numberObject class number by user-defined classification
    obj_speednumberObject speed, km/h
    sensor_idstring (format: uuid)Sensor unique identifier
    close_typewhole number, nullEvent closure type
    obj_lengthnumberObject length, meters. Is used for object class detection
    start_timestring (format: date-time)The end of event
    descriptionarrayEvent name on all accessible languages
    langstringLanguages
    namestringEvent name
    projects_idstring (format: uuid)Project unique identifier
    measure_linewhole number, nullAlways null

    events response parameters description

    Response parameterParameters calculations/default values
    valFor boolean events – 1, for quantifiable events – matching numeric value. For example, if speeding detected, first received value according to event rule will be written
    codeEvent codes are set by the user while the event creation. Event codes updates and changes won't affect already recorded events
    type1 – Speed events, 2 – Traffic events, 9 – Others events. It matches the event rules settings in the System
    unitKMH – kilometer per hour, MPS - meters per second, PEDESTRIAN – a pedestrian detected, PLACE – object is in the scope, STOP – vehicle stop, WWD – wrong direction
    zoneIs created in Road Management section
    level0 – Information event, 1 – Warning event, 2 – Critical event. It matches the event rules settings in the System
    obj_classClasses numeration start with «0». If sensor isn't able to detect vehicle class, then value is «-1»
    close_type0 – Auto, 1 – Manual, NULL – Not closed