|
|
Home |
|
|
\ No newline at end of file |
|
|
**Use case 14** is dedicated to information regarding loading and unloading areas.
|
|
|
|
|
|
This use case allows the providers to send information in real time to the loading and unloading areas.
|
|
|
|
|
|
The platform has a functionality for the **publication (sending)** of information through a REST API.
|
|
|
|
|
|
The publication functionality requires an access certificate that must be requested and supplied by DGT 3.0. This certificate, if not already requested, must be requested to *[soporte@cmobility30.es](mailto:soporte@cmobility30.es)*.
|
|
|
|
|
|
Below are the URLs with which each functionality is accessed:
|
|
|
|
|
|
| Mode | URL | Description |
|
|
|
| ----------- | -------------------------------------- | ------------------------------------------------------ |
|
|
|
| Publication | https://pre.cmobility30.es/use-case-14 | Client integration environment endpoint for publishing |
|
|
|
|
|
|
The functionality is described below.
|
|
|
|
|
|
## Publication
|
|
|
|
|
|
This use case has a REST API for the publication (sending) of the data by the companies that request it. Details of this can be found in the following sections:
|
|
|
|
|
|
- General details for making a request:
|
|
|
|
|
|
> [General · (cmobility30.es)](https://gitlab.cs.cmobility30.es/dgt3.0_esp/general/-/wikis/home)
|
|
|
|
|
|
- The structure of the event can be seen here:
|
|
|
|
|
|
> [Event](publicacion/Event)
|
|
|
|
|
|
- Information regarding the specific methods of the use case:
|
|
|
|
|
|
> [Methods](publicacion/Methods)
|
|
|
|
|
|
## 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 |
|
|
|
| 13 | Unique key violated |
|
|
|
| 14 | There is an error in one or more elements |
|
|
|
| 15 | Invalid GeoJson |
|
|
|
| 16 | GeoJson does not belong to municipality |
|
|
|
|
|
|
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": "[municipalityIneCode: must not be null, capacity: must not be null]"
|
|
|
}
|
|
|
```
|
|
|
|
|
|
#### Server Error
|
|
|
|
|
|
- HTTP Status: **500 - Internal Server Error**
|
|
|
|
|
|
| Code | Message |
|
|
|
| ---- | -------------- |
|
|
|
| 18 | Internal error | |
|
|
\ No newline at end of file |