Sau đây là ví dụ về nội dung yêu cầu cURL cho một tuyến có một điểm xuất phát và một điểm đến. Phương thức này sử dụng mặt nạ trường để yêu cầu mã thông báo tuyến, cùng với thời lượng tuyến, quãng đường và đường đa tuyến của tuyến:
[null,null,["Cập nhật lần gần đây nhất: 2025-02-06 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"]]