Here's an example cURL request body for a single origin, single-destination
route. It uses field masks to request a route token, along with the route
duration, distance, and route polyline:
[null,null,["Last updated 2025-02-24 UTC."],[[["To get a route token from the Routes API, you must set `travelMode` to `DRIVE` and `routingPreference` to either `TRAFFIC_AWARE` or `TRAFFIC_AWARE_OPTIMAL`."],["Ensure that none of your route waypoints are via waypoints when requesting a route token."],["Use the `routes.routeToken` field mask in your request to ensure that a route token is returned."],["The route generated with a token may vary slightly from the planned route due to dynamic road conditions, and it's recommended to use the token soon after generation."],["The route token can be used in the Navigation SDK for your planned route."]]],["To obtain a route token from the Routes API, set `travelMode` to `DRIVE` and `routingPreference` to `TRAFFIC_AWARE` or `TRAFFIC_AWARE_OPTIMAL`. Ensure no waypoints are \"via\" waypoints. Include `routes.routeToken` in the `X-Goog-FieldMask`. Use the token promptly, as dynamic road conditions can cause deviations. The token can be used in the Navigation SDK. An example cURL request demonstrates how to request a token with other route data.\n"]]