Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Für jede Anfrage an die Roads Selection API müssen Sie die folgenden Informationen angeben:
Die Nummer oder ID Ihres Google Cloud-Projekts im X-Goog-User-Project-Header der Anfrage. Mit diesem Wert wird das Projekt für die Abrechnung und die Berechnung des Nutzungskontingents festgelegt.
Ein OAuth-Token im Header Authorization der Anfrage. Weitere Informationen zur Verwendung von OAuth mit der Roads Selection API finden Sie unter OAuth verwenden.
Eine Google Cloud-Projektnummer oder ‑ID in der Anfrage-URL. Dieser Wert gibt das Projekt an, das die SelectedRoute-Ressource enthält. Dieses Projekt ist in der Regel dasselbe wie das im X-Goog-User-Project-Header angegebene Projekt, muss aber nicht dasselbe sein.
Die selectedRouteId in der Anfrage-URL. Wenn Sie eine Aktion für eine bestimmte SelectedRoute ausführen, übergeben Sie die ID der ausgewählten Route als Teil der Anfrage-URL.
Das folgende Codebeispiel zeigt die Struktur einer Anfrage zum Löschen einer ausgewählten Route mit allen oben genannten Elementen:
Das folgende Codebeispiel zeigt die Struktur einer Anfrage zum Löschen einer ausgewählten Route mit allen oben genannten Elementen:
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Benötigte Informationen nicht gefunden","missingTheInformationINeed","thumb-down"],["Zu umständlich/zu viele Schritte","tooComplicatedTooManySteps","thumb-down"],["Nicht mehr aktuell","outOfDate","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Problem mit Beispielen/Code","samplesCodeIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-09-04 (UTC)."],[],[],null,["# Request requirements\n\nTo make any request to the Roads Selection API, you must include the following\ninformation:\n\n- 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.\n\n| **Note:** If you are using a service account for authentication, you can omit the `X-Goog-User-Project` header. For more information about service accounts, see [Authentication at\n| Google](https://cloud.google.com/docs/authentication).\n\n- An OAuth token in the `Authorization` header of the request. For more\n information about using OAuth with the Roads Selection API, see [Use\n OAuth](/maps/documentation/roads-management-insights/roads-selection/oauth-token).\n\n- A Google Cloud project number or ID in the request URL. This value specifies\n the project that contains the [`SelectedRoute`](/maps/documentation/roads-management-insights/reference/rest/v1/selection.v1.projects.selectedRoutes#SelectedRoute) resource. While this\n project is usually the same as the project specified in the\n `X-Goog-User-Project` header, it is not required to be the same.\n\n- The **[`selectedRouteId`](/maps/documentation/roads-management-insights/reference/rest/v1/selection.v1.projects.selectedRoutes/create#body.selected_route_id)** in the request URL. Whenever you perform an\n action on a specific [`SelectedRoute`](/maps/documentation/roads-management-insights/reference/rest/v1/selection.v1.projects.selectedRoutes#SelectedRoute), you pass the ID of the selected\n route as part of the request URL.\n\nAs a request example, the following code sample shows the structure of a request\nto [delete](/maps/documentation/roads-management-insights/reference/rest/v1/selection.v1.projects.selectedRoutes/delete) a selected route with all the elements previously mentioned:\n\nAs a request example, the following code sample shows the structure of a request\nto delete a selected route with all the elements previously mentioned: \n\n```\ncurl -X DELETE \\\n-H 'X-Goog-User-Project: PROJECT_NUMBER' \\\n-H \"Authorization: Bearer ACCESS_TOKEN\" \\\n https://roads.googleapis.com/selection/v1/projects/PROJECT_NUMBER/selectedRoutes/SELECTED_ROUTE_ID\n```\n\nGet your project number\n-----------------------\n\nTo get the project number of your Google Cloud project:\n\n1. Go to the project's [Overview\n page](https://console.cloud.google.com/home/dashboard) in\n the Google Cloud console.\n\n2. If prompted, select your project.\n\n3. The **Project number** and **Project ID** appear in the **Project info**\n area of the overview screen."]]