Event - dgt30-eng/Use-case-13 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": 2, "timestamp": "2021-03-15T13:34:00.000Z", "lonStart": -3.45368, "latStart": -3.45368, "lonEnd": 40.36586, "latEnd": 40.36586, "hdop": 1, "deviceTypeId": 1, "speed": 120, "eventTypeId": 2 }
* = 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 = Individual, 2 = Group
-
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. The date must end with the character 'Z' that marks that it is in UTC
-
lonStart * (decimal number): longitude in WGS 84 coordinate systems where the event was generated
-
latStart * (decimal number): latitude in WGS 84 coordinate system where the event was generated
-
lonEnd (decimal number): longitude in WGS 84 coordinate system where the event ended
-
latEnd (decimal number): latitude in WGS 84 coordinate system where the event ended
-
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 = App
-
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
-
Given the criticality of the position of these devices as they are linked to people on bicycles, a maximum message sending frequency of one message every 15 seconds is established.
-
The position provided by the GPS must not have an error greater than 5 meters
-
A maximum age of 15 seconds from UTC time is required, and that they are not future timestamp events.
-
The fields lonEnd and latEnd are required if beaconTypeId is of type 2 = Group
-
The order and quantity of the messages are set out below:
- Events of type Activado, as many messages as the activity of the cyclists lasts.
- Events of type Apagado, a single message.