Event - dgt30-eng/Use-case-12 GitHub Wiki
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": 0, "hdop": 1, "deviceTypeId": 3, "deviceUseTypeId": 3, "speed": 0, "eventTypeId": 1, "beaconDown": false }
* = 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 15 seconds old with respect to UTC time,and furthermore it cannot be a future timestamp. 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. 0 = None, 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, 3 = Infrastructure
-
speed * (integer number): speed measured in kilometers per hour at which the element is at the moment it sends the event
-
evenTypeId * : identifier of the event type. Possible values 1 = On, 2 = Activated, 3 = Off
-
beaconDown (boolean): allows to know if the cone is physically down. Possible values: true (if down), false (if up). This will be a required field for cones
-
Note: In case the device type is a cone (deviceType = 3), the following fields must have certain values:
-
vehicleType = 0 (None)
-
deviceUseType = 3 (Infrastructure)
-
beaconTypeId = 1 (Start)
-
speed < 10
-
beaconDown = true/false
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
-
The order, quantity and frequency of messages are set out below:
- Events of type Encendido, a single message (optional).
- Events of type Activado, as many messages as the activity of the beacon lasts with a frequency of 10 minutes between messages.
- Events of type Apagado, a single message.
-
In the case that the type of device is a connected cone (deviceTypeId = 3), the maximum frequency of sending the message will be 10 minutes