U

Use case 9

Towing truck location information in real time.

Use Case 9 is dedicated to information related to the ubication of towing trucks in real time.

It is an interface to receive the information sent by the different towing truck operators with the dynamic geopositioning information of the vehicle and the states during the rescue operation. This information will be processed and informative events will be generated that will be published by the outbox, so that third parties that connect and can provide the information to their users.

The platform has two different functionalities for the publication (sending) and for the subscription (reception) of information. The first is through a REST API and the second through a real-time MQTT service.

Both the publication and subscription functionality require different access certificates that must be requested and supplied by DGT 3.0. If these certificates have not already been requested, they should be requested from soporte@cmobility30.es.

Below are the URLs with which each functionality is accessed:

Mode URL Description
Publication https://pre.cmobility30.es/use-case-9 Client integration environment endpoint for publishing
Subscription mqtt://mqtt.pre.cmobility30.es:8883 Integration environment endpoint for subscription

The two functionalities are 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)

  • The details of the master tables and data that can compose the event:

Master Tables

  • The structure of the event can be seen here:

Event

Consumption

The data received as "Intervention" event type by this use case will be published as static events through the outbox.

Information regarding this platform can be found here

The response of the consumption request will be a list of elements like the following:

{
            "pmvGeomWkt": null,
            "pmvId": 511,
            "pmvMsg": "VAC en intervención",
            "pmvImg": "P50",
            "pmvType": 1,
            "pmvProv": null,
            "pmvRoad": null,
            "pmvPk": 0.0,
            "pmvPkIni": 0.0,
            "pmvPkFin": 0.0,
            "pmvDirection": 1,
            "pmvCategory": null,
            "pmvMode": null,
            "pmvProvFin": 0,
            "pmvRoadFin": null,
            "pmvEvent": 0,
            "gid": null
}
  • pmvGeomWkt: Does not apply

  • pmvId: PMV Identification number

  • pmvMsg: VAC status message

  • pmvImg: Does not apply

  • pmvType: PMV type

  • pmvProv: Event province

  • pmvRoad: Event road

  • pmvPk: Event road kilometer

  • pmvPkIni: Does not apply

  • pmvPkFin: Does not apply

  • pmvDirection: Event road direction

  • pmvCategory: PMV Category

  • pmvMode: PMV Mode

  • pmvProvFin: Does not apply

  • pmwRoadFin: Does not apply

  • pmvEvent: Does not apply

  • gid: Does not apply

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:

{
    "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 Permission denied. Role assigned to user missing
    13 There is an error in one or more elements of the list
    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

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:

{
    "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
    17 Internal error