Request requirements

To make any request to the Roads Selection API, you must include the following information:

  • The number or ID of your Google Cloud project in the X-Goog-User-Project header of the request. This value determines the project used for billing and usage quota calculations.
  • An OAuth token in the Authorization header of the request. For more information about using OAuth with the Roads Selection API, see Use OAuth.

  • A Google Cloud project number or ID in the request URL. This value specifies the project that contains the SelectedRoute resource. While this project is usually the same as the project specified in the X-Goog-User-Project header, it is not required to be the same.

  • The selectedRouteId in the request URL. Whenever you perform an action on a specific SelectedRoute, you pass the ID of the selected route as part of the request URL.

As a request example, the following code sample shows the structure of a request to delete a selected route with all the elements previously mentioned:

As a request example, the following code sample shows the structure of a request to delete a selected route with all the elements previously mentioned:

curl -X DELETE \
-H 'X-Goog-User-Project: PROJECT_NUMBER' \
-H "Authorization: Bearer ACCESS_TOKEN" \
 https://roads.googleapis.com/selection/v1/projects/PROJECT_NUMBER/selectedRoutes/SELECTED_ROUTE_ID

Get your project number

To get the project number of your Google Cloud project:

  1. Go to the project's Overview page in the Google Cloud console.

  2. If prompted, select your project.

  3. The Project number and Project ID appear in the Project info area of the overview screen.