The event is the main part of this data ingestion API. This element is where the information of the event generated by each of the devices will be sent to the platform in real time.
-
Method: POST
-
URL: {baseUrl}/v1/events
-
Body:
{ "actionId": "CLI_235", "beaconId": "cff92179-dc0a-47da-bd9e-5e9c5b14d251", "beaconTypeId": 1, "timestamp": "2021-03-15T13:34:00.000Z", "lon": -3.45368, "lat": 40.36586, "vehicleTypeId": 1, "hdop": 1, "deviceTypeId": 1, "deviceUseTypeId": 1, "speed": 120 }
* = Required field
-
actionId * (text): unique event identifier
-
beaconId * (text): unique beacon identifier (for example, the MAC)
-
beaconTypeId * (integer number): beacon type identifier. Possible values in / beaconTypes. 1 = Start, 2 = End, 3 = Intermediate, 4 = Unique
-
timestamp * (UTC time): date and time in UTC format of when the event was generated. It must be a maximum of 30 seconds old with respect to UTC time. The date must end with the character 'Z' that marks that it is in UTC
-
lon * (decimal number): longitude in WGS 84 coordinate system where the event was generated
-
lat * (decimal number): latitude in WGS 84 coordinate system where the event was generated
-
vehicleTypeId* (integer number): vehicle type identifier. Possible values in / vehicleTypes. 1 = Car, 2 = Motorbike
-
hdop * (integer number): DOP value to determine the quality of the GPS information. More information here
-
deviceTypeId * (integer number): identifier of the type of device from which the information is sent. Possible values in / deviceTypes. 1 = Baliza, 2 = Chaleco, 3 = Cono conectado
-
deviceUseTypeId * (integer number): identifier of the type of use of the device that sends the information. Possible values in / deviceUseTypes. 1 = Worker, 2 = Vehicle
-
speed * (integer number): speed measured in kilometers per hour at which the element is at the moment it sends the event
In order to maintain the quality of the messages, the following requirements will apply to the content of the messages:
-
The geographical position must be contained in the Spanish territory
-
The position provided by the GPS must not have an error greater than 5 meters
-
Given the criticality of this information, events will be required to be generated from the moment workers enter the risk zone, and stop being sent when they leave it
-
A maximum age of 15 seconds from UTC time is required
-
A refresh rate of 15 seconds is estimated for roads with a maximum speed of 120 km / h and 20 seconds for roads with a maximum speed of less than or equal to 90 km / h from the moment of entry, and during the entire stay within the road risk zone
-
In the case that the type of device is a connected cone (deviceTypeId = 3), the frequency of sending the message will be at least 10 minutes
-