Driver Schema
Model
Driver
Driver =
object
The driver data. All drivers in the API will have this format.
Example
{
"id": "drivers/w8ZaNn3e5ZA8EQSABtca",
"name": "John Doe",
"email": "john.doe@spoke.com",
"phone": "+15555555555",
"displayName": "John D.",
"active": true,
"depots": [
"depots/zeOCJaJCzZhpKVCVAC9o"
],
"routeOverrides": {
"startTime": {
"hour": 8,
"minute": 0
},
"endTime": {
"hour": 8,
"minute": 0
},
"startAddress": {
"address": "Very nice St., 150 - Nice Neighbourhood, Campinas - SP, 130876, Brazil",
"placeId": "1cda3f263368264eefbb",
"latitude": -22.12345,
"longitude": -47.12345,
"placeTypes": [
"street_address"
],
"addressLineOne": "Very nice St., 150",
"addressLineTwo": "Nice Neighbourhood, Campinas - SP, 130876, Brazil"
},
"endAddress": {
"address": "Very nice St., 150 - Nice Neighbourhood, Campinas - SP, 130876, Brazil",
"placeId": "1cda3f263368264eefbb",
"latitude": -22.12345,
"longitude": -47.12345,
"placeTypes": [
"street_address"
],
"addressLineOne": "Very nice St., 150",
"addressLineTwo": "Nice Neighbourhood, Campinas - SP, 130876, Brazil"
},
"maxStops": 30,
"drivingSpeed": "average",
"deliverySpeed": "faster"
}
}
Properties
| Property | Type | Description |
|---|---|---|
|
‐ | ||
|
|
Full user name Default | |
|
|
User email Default | |
|
|
Phone number in E.164 format Default | |
|
|
User name for display purposes | |
|
|
If true, the driver membership is active and the driver can be assigned to
plans/routes.
| |
|
|
Depots associated with the Driver. See Depot. Default | |
|
A set of settings per driver to override default route configurations. |
Identifier
DepotId
DepotId =
`depots/${string}`
A depot id is a string that is unique for a depot. It is used to identify the depot in the API.
Example
"depot/0xBYy4MYt4piMCSQEsts"
DriverId
DriverId =
`drivers/${string}`
A driver id is a string that is unique for a driver. It is used to identify the driver in the API.
Example
"drivers/0xBYy4MYt4piMCSQEsts"
Fields
RelativeSpeed
RelativeSpeed =
"slower"|"average"|"faster"
An indication of relative speed compared to the average speed for some activity. Such activities can be, for example, driving and delivering.
VehicleType
VehicleType =
"bike"|"scooter"|"car"|"small_truck"|"truck"|"electric_cargo_bike"
Possible vehicle types used by the driver. Some paths may be available to some vehicles but not to others. As such, the vehicle type impacts optimization by limiting or enabling certain paths in the driver's route.
DriverRouteOverrides
DriverRouteOverrides =
object
Settings per driver to override default route configurations. Editing this object achieve the same functionalities of the tab "Route overrides" when editing a driver in Spoke Dispatch. All settings are optional and default to route settings, for example start and end locations from Depot, but can be overriden on each driver via this object.
Example
{
"startTime": {
"hour": 8,
"minute": 0
},
"endTime": {
"hour": 8,
"minute": 0
},
"startAddress": {
"address": "Very nice St., 150 - Nice Neighbourhood, Campinas - SP, 130876, Brazil",
"placeId": "1cda3f263368264eefbb",
"latitude": -22.12345,
"longitude": -47.12345,
"placeTypes": [
"street_address"
],
"addressLineOne": "Very nice St., 150",
"addressLineTwo": "Nice Neighbourhood, Campinas - SP, 130876, Brazil"
},
"endAddress": {
"address": "Very nice St., 150 - Nice Neighbourhood, Campinas - SP, 130876, Brazil",
"placeId": "1cda3f263368264eefbb",
"latitude": -22.12345,
"longitude": -47.12345,
"placeTypes": [
"street_address"
],
"addressLineOne": "Very nice St., 150",
"addressLineTwo": "Nice Neighbourhood, Campinas - SP, 130876, Brazil"
},
"maxStops": 30,
"drivingSpeed": "average",
"deliverySpeed": "faster"
"vehicleType": "truck"
}
Properties
| Property | Type | Description |
|---|---|---|
|
|
The time of day that the Driver starts working. When null, the start time configured for the Depot will be taken into consideration when optmizing plans and distributing routes to drivers. Default | |
|
|
The time of day that the Driver finishes working. When null, the end time configured for the Depot will be taken into consideration when optimizing plans and distributing routes to drivers. Default | |
|
|
A complete address to the location where the driver must always begin at. Optional. If null the start location of routes will be the Depot associated with the route assigned to the driver. Default | |
|
|
A complete address to the location where the driver must always end at. Optional. If null the end location of routes will be the end location of the Depot associated with the route assigned to the driver or the driver's start location if "return to start location" is set. Default | |
|
|
The maximum number of stops the driver must have per route. Optional. If null, the Depot's maximum number of stops per driver will be used instead. Default | |
|
How fast the driver drives from stop to stop, compared to the average speed all drivers usually drive. This value defaults to "average" and if specified as "slower" or "faster", it will be taken into considerattion when optimizing routes. Default | ||
|
How fast the driver completes deliveries, compared to the average of all drivers. This value defaults to "average" and if specified as "slower" or "faster", it will be taken into considerattion when optimizing routes. Default | ||
|
|
The vehicle type the driver uses. It may affect optimization, as some paths are available to certain vehicles but not to others. Default |
DriverAddress
DriverAddress =
object
Data used to identify the stop location.
Example
{
"address": "Very nice St., 150 - Nice Neighbourhood, Campinas - SP, 130876, Brazil",
"placeId": "1cda3f263368264eefbb",
"latitude": -22.12345,
"longitude": -47.12345,
"placeTypes": [
"street_address"
],
"addressLineOne": "Very nice St., 150",
"addressLineTwo": "Nice Neighbourhood, Campinas - SP, 130876, Brazil"
},
Properties
| Property | Type | Description |
|---|---|---|
|
|
Combined address string. Default '' It will always be an empty string | |
|
|
First line of the address. Default | |
|
|
Second line of the address. Default | |
|
|
Latitude coordinate of the stop location in decimal degrees. Default | |
|
|
Longitude coordinate of the stop location in decimal degrees. Default | |
|
|
The identifier of the Place corresponding to this stop on Google Places. Default | |
|
|
Array of strings that is provided by the Google AutoCompleteAPI. Default |
TimeOfDay
TimeOfDay =
object
The time of day in hours and minutes.
The time of day in hours and minutes.
Example
{
"hour": 8,
"minute": 0
}
Properties
| Property | Type | Description |
|---|---|---|
|
|
The hour of the day in 24-hour format. | |
|
|
The minute of the hour. |