Activity Message
An Activity message is generated when the drivers current activity changes.
The Drivers App contains a feature to keep track of the activity of the driver. This should not be confused with activities within a trip. The activity tracking feature is a completely separate feature and still works without trips.
Activity tracking starts as soon as the driver starts its shift with the "Start trip" activity. During a shift there is always just one active activity. Starting a new activity automatically ends the previous activity. As a result, 2 Activity messages are generated when switching activity
A message for finishing the current activity
A message for starting the new activity
The data field of an Activity message always contains the properties described below.
Property | Nullable | Type | Description |
|---|---|---|---|
id | false | string | A unique identifier (UUIDv4) for this activity record. The finish activity message has the same ID as the start activity message, because they both reference the same activity. |
activity | false | string | The name of the activity. By default, the English name of the activity is used. The language can be changed upon request. |
code | false | integer | A unique identifier for a type of activity. It is recommended to use this value for identifying activities instead of the |
startTime | false | string | ISO 8601 formatted timestamp of when the activity was started. |
startTimeMillis | false | long | Unix timestamp (milliseconds) of when the activity was started. |
endTime | true | string | ISO 8601 formatted timestamp of when the activity was finished. When an activity has not yet been finished, this field is |
endTimeMillis | true | long | Unix timestamp (milliseconds) of when the activity was finished. When an activity has not yet been finished, this field is |
foreignId | true | string | If an activity is started/finished between arriving at and signing-off a stop, this field contains the foreignId of related Entity. |
questionnaire | true | Sine activities may be configured with a questionnaire. If this is the case, this field contains the answers to the questionnaire. |
Co-driver
When the co-driver functionality is enabled both the main driver and the co-driver share the same activities. Each activity message is just sent once. The OriginObject contains both the driverNumber of the main driver (driverNumber) and the co-driver (coDriverNumber)
There are a few important events which cause the driver/co-driver to change. These events are:
A co-driver joins the main driver during a shift
The main driver and co-driver switch places
A co-driver leaves the driver during a shift
All of the above events also trigger an activity change. Some examples are included below.
Examples
The examples below contain different types of Activity messages. Each example contains a JSON snippet together with a brief explanation.
The example below contains a possible Activity message generated when the driver starts the "Unloading" activity.
The example below contains a possible Activity message generated when the driver finishes the "Unloading" activity.
The example below contains a possible Activity message generated when the driver starts the "Waiting" activity.
In this example both the foreignId and questionnaire fields contains a value. The foreignId field refers to the stop Entity this activity is related to. The questionnaire field contains the answers to a questionnaire asked when starting the activity.
The example below contains a possible Activity message generated when a co-driver joins during a shift.
In this example both the driverNumber and coDriverNumber fields contain a value. The value in coDriverNumber is the driver number of the co-driver that joined the main driver during a shift.
The example below contains a possible Activity message generated when the main driver and co-driver swap places.
In this example the driver with driver number 1 (previously the co-driver) becomes the main driver. The driver with driver number 2 (previously the main driver) becomes the co-driver.
The example below contains a possible Activity message generated when the co-driver leaves the main driver during a shift.
In this example the co-driver (with driver number 2) leaves the main driver (with driver number 1) during the shift.