... | @@ -53,6 +53,8 @@ In the topic, the events are published in JSON format. Here you can see an examp |
... | @@ -53,6 +53,8 @@ In the topic, the events are published in JSON format. Here you can see an examp |
|
|
|
|
|
```json
|
|
```json
|
|
{
|
|
{
|
|
|
|
"actionId": "CLI_235",
|
|
|
|
"beaconId": "cff92179-dc0a-47da-bd9e-5e9c5b14d251",
|
|
"beaconTypeId": 1,
|
|
"beaconTypeId": 1,
|
|
"timestamp": "2021-06-02T13:34:56.747Z",
|
|
"timestamp": "2021-06-02T13:34:56.747Z",
|
|
"lon": -4.304818,
|
|
"lon": -4.304818,
|
... | @@ -66,6 +68,10 @@ In the topic, the events are published in JSON format. Here you can see an examp |
... | @@ -66,6 +68,10 @@ In the topic, the events are published in JSON format. Here you can see an examp |
|
}
|
|
}
|
|
```
|
|
```
|
|
|
|
|
|
|
|
- actionId (text): unique identifier of the event
|
|
|
|
|
|
|
|
- beaconId (text): unique identifier of the beacon (for example, the MAC)
|
|
|
|
|
|
- beaconTypeId (integer number): beacon type identifier. 1 = Start, 2 = End, 3 = Intermediate, 4 = Unique
|
|
- beaconTypeId (integer number): beacon type identifier. 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
|
|
- 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
|
... | @@ -93,3 +99,62 @@ In the topic, the events are published in JSON format. Here you can see an examp |
... | @@ -93,3 +99,62 @@ In the topic, the events are published in JSON format. Here you can see an examp |
|
See more information and a connection example [here](https://gitlab.cs.cmobility30.es/dgt3.0_eng/general/-/wikis/MQTT).
|
|
See more information and a connection example [here](https://gitlab.cs.cmobility30.es/dgt3.0_eng/general/-/wikis/MQTT).
|
|
|
|
|
|
**Note:** *The information that is being published in the development environment is a simulation with non-real information that changes throughout the day, so that the consumer interface can be tested.*
|
|
**Note:** *The information that is being published in the development environment is a simulation with non-real information that changes throughout the day, so that the consumer interface can be tested.*
|
|
|
|
|
|
|
|
## Errors
|
|
|
|
|
|
|
|
As stated above, all HTTP responses other than **200 – OK**, can be considered **invalid**. The format of the error response is like the following example:
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"status": 401,
|
|
|
|
"code": 1,
|
|
|
|
"message": "User not found or valid"
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
These errors will have three main categories:
|
|
|
|
|
|
|
|
#### Authentication Error
|
|
|
|
|
|
|
|
- HTTP Status: **401 - Unauthorized**
|
|
|
|
|
|
|
|
| Code | Message |
|
|
|
|
| ---- | ----------------------- |
|
|
|
|
| 1 | User not found or valid |
|
|
|
|
|
|
|
|
#### Client Error
|
|
|
|
|
|
|
|
- HTTP Status: **400 - Bad Request**
|
|
|
|
|
|
|
|
| Code | Message |
|
|
|
|
| ---- | ------------------------------------------------------------------- |
|
|
|
|
| 0 | Authenticate |
|
|
|
|
| 2 | Entity ID not found |
|
|
|
|
| 3 | Missing required property |
|
|
|
|
| 4 | The entity received cannot be proccessed |
|
|
|
|
| 5 | Incorrect token received |
|
|
|
|
| 6 | Expired token received |
|
|
|
|
| 7 | There is an error with the token provided. Please request a new one |
|
|
|
|
| 8 | No token received |
|
|
|
|
| 9 | Required request body is missing |
|
|
|
|
| 10 | Event is marked as expired by timestamp |
|
|
|
|
| 11 | Missing request header |
|
|
|
|
| 12 | Access denied role |
|
|
|
|
|
|
|
|
In the case of getting an error *3 - Missing required property*, the response obtained will have a value in the message that will indicate the missing fields to send:
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"status": 400,
|
|
|
|
"code": 3,
|
|
|
|
"message": "[deviceTypeId: must not be null, deviceUseTypeId: must not be null, informationQualityId: must not be null]"
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
#### Server Error
|
|
|
|
|
|
|
|
- HTTP Status: **500 - Internal Server Error**
|
|
|
|
|
|
|
|
| Code | Message |
|
|
|
|
| ---- | -------------- |
|
|
|
|
| 13 | Internal error | |