Trip messages
This chapter describes the different types of trip messages within the FleetGO Drivers App Interface.
Message structure
The FleetGO Drivers App Interface consists of 2 different types of trip messages that can be sent to a device:
Update messages - Used for sending a new trip or updating an existing trip
Delete messages - Used for deleting a trip
Each trip message consists of an action and data field as described below.
Property | Required | Type | Description |
|---|---|---|---|
action | true | string | Used to describe which action should be performed. Possible values are:
|
data | true | The data field should contain an Entity representing the trip. Please refer to the Entity chapter for more details. |
When updating a trip using the update action, the trip is first deleted cascadingly. After deleting the trip, the data field gets parsed and saved. The data field should thus always contain the full representation of the trip. Partial updates are not supported.
Examples
The example below contains a JSON representation of a message to send/update a trip. The data fields contains an Entity representing the trip.
After successfully processing the message, an EntityReceived message is generated.
The example below contains a JSON representation of message to delete a trip. When sending a delete message it is sufficient to just include the foreignId, title and flag. All other entity fields like meta and rank are ignored. If the title field is empty or not present, the foreignId field is shown to the user.
Deleting an entity happens cascadingly. After successfully deleting a trip, an EntityDeleted is generated.