... | ... | @@ -57,71 +57,6 @@ versión 1 obtendremos la siguiente URL: |
|
|
|
|
|
<img title="" src="https://i.loli.net/2021/03/24/N759fRtgE2PWn8h.png" alt="2021-03-24-13-21-32-image.png" data-align="center">
|
|
|
|
|
|
## Errores
|
|
|
|
|
|
Como se ha indicado anteriormente, todas las respuestas HTTP que no sean **200 – OK**, se pueden considerar **inválidas**. El formato de la respuesta de error es como el siguiente ejemplo:
|
|
|
|
|
|
```json
|
|
|
{
|
|
|
"status": 401,
|
|
|
"code": 1,
|
|
|
"message": "User not found or valid"
|
|
|
}
|
|
|
```
|
|
|
|
|
|
*Esto no aplica para el **Caso de Uso 9 - Grúas**. La información relativa a los errores en ese caso se puede encontrar aquí.
|
|
|
|
|
|
Estos errores tendrán tres categorías principales:
|
|
|
|
|
|
#### Error de Autentificación
|
|
|
|
|
|
- HTTP Status: **401 - Unauthorized**
|
|
|
|
|
|
| Code | Message |
|
|
|
| ---- | ----------------------- |
|
|
|
| 1 | User not found or valid |
|
|
|
|
|
|
#### Error de Cliente
|
|
|
|
|
|
- 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 |
|
|
|
| 13 | There is an error in one or more elements |
|
|
|
| 14 | The actionId must be unique. This one has been already used |
|
|
|
| 15 | The event type is 3. However, event has not been started |
|
|
|
| 16 | The event has already been marked as finished |
|
|
|
|
|
|
En el caso de obtener un *error 3 - Missing required property* la respuesta obtenida tendrá un valor en el *message* que nos indicará los campos que faltan por enviar:
|
|
|
|
|
|
```json
|
|
|
{
|
|
|
"status": 400,
|
|
|
"code": 3,
|
|
|
"message": "[deviceTypeId: must not be null, deviceUseTypeId: must not be null, informationQualityId: must not be null]"
|
|
|
}
|
|
|
```
|
|
|
|
|
|
#### Error de Servidor
|
|
|
|
|
|
- HTTP Status: **500 - Internal Server Error**
|
|
|
|
|
|
| Code | Message |
|
|
|
| ---- | -------------- |
|
|
|
| 17 | Internal error |
|
|
|
|
|
|
## Swagger
|
|
|
|
|
|
La aplicación dispone de un Swagger autogenerado por el propio código donde se pueden encontrar los diferentes *endpoints*.
|
... | ... | |