Route IDs
A route can be represented by a route ID which can be requested when calculating a route. It can also be the representation of an alternative route returned by a route calculation.
This route ID can then be used in subsequent requests to refer to that route and is valid for 12 hours.
Recalculate the route with different parameters
When the route ID is requested with a route calculation, it can be used instead of the waypoint list in subsequent requests to recalculate results. The path of the route will not change nor the distance or the polyline, only results such as the travel time, toll, emissions or events may change according to the specified parameters.
This feature can be used to find out the travel time for the same route at a different date and time. When using options[trafficMode]=REALISTIC the travel time may change with every request. The route may even become violated when a road on the route is blocked for the specified vehicle at that date and time.
To find out the toll prices for the same route with a different vehicle, specify the vehicle parameters or the vehicle profile accordingly. The route may become violated when a road on the route is blocked for the specified vehicle, e.g. a weight or a height violation. When changing the profile the route calculation may even fail, e.g. when calculating a truck route for a bicycle using highways.
The parameters options[allowedCountries] and options[prohibitedCountries] will be ignored, and a warning will be issued.
Fetch the route results once again
Using getRouteByRouteId the results of the initial route calculation can be fetched again. The result will contain all results of the initial route calculation and use the same parameters. The path of the route will not change nor the distance or the polyline, but other results may be slightly different as some data may have changed, in particular live traffic but also exchange rates, custom road attributes or even map data when being updated.
Calculate the estimated time of arrival and reachable areas and locations
The route ID can also be used to refer to a route path when calculating the estimated time of arrival as well as reachable areas and reachable locations. For these operations only the path of the route will be used. All other results of the route represented by the route ID will be ignored.
Note
The route represented by a route ID will automatically be updated when being used for the first time after the map has been updated. A new map may mean in some cases that the route will be different from the initial one, for example, when roads used by the route have changed or were deleted in the new map. The request which updates the route will issue a warning ROUTING_UPDATED_ROUTE_ID in order to notify on update of the route.
Try it in the RouteIds code sample.