When vehicles perform adhoc routes (as opposed to repeated routes that are defined in route templates), it is possible to define a route for a specific vehicle activity and assign it immediately. The API method to use is POST /v2/vehicles/{vehicleId}/assignRoute.
The URL parameter vehicleId is the ID of the vehicle to which the route should be assigned.
The optional URL parameter sendToWFMNAV can be set to true, if the route should also be sent to a WFM or NAV terminal associated to the vehicle.
In the body of the request, it is possible to define all the necessary parameters of route. The following example shows an example route, with two steps:
{
"name": "TEST",
"steps": [
{
"starts": {
"planned": "2020-04-14T14:16:52.2640472Z",
"coordinates": {
"latitude": 38.7212989,
"longitude": -9.234454399999999
}
},
"arrive": {
"planned": "2020-04-14T15:30:45.264",
"coordinates": {
"latitude": 39.2336572,
"longitude": -8.685893000000002
}
},
"times": {
"stopOver": 180
}
},
{
"starts": {
"planned": "2020-04-14T15:30:45.264",
"coordinates": {
"latitude": 39.2336572,
"longitude": -8.685893000000002
}
},
"arrive": {
"planned": "2020-04-14T16:17:29.264",
"coordinates": {
"latitude": 39.4053585,
"longitude": -9.130054099999999
}
},
"times": {
"stopOver": 120
}
}
]
}
No polyline is defined, so Frotcom will take the start and arrive coordinates of each step to generate the route path automatically. To send the route path, it has to be encoded using Google Polyline format described here: https://developers.google.com/maps/documentation/utilities/polylinealgorithm
To define the breaks allowed during step, add the parameter break next to stopOver inside the group times. The value must be defined in seconds.
Use the sections notifications and alarms to define automatic notifications and alarms for each route step.
Comments