Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Aby wysłać żądanie do interfejsu Maps Datasets API, musisz podać:
Numer lub identyfikator projektu Google Cloud w X-Goog-User-Projectnagłówku żądania. Ta wartość określa projekt używany do obliczania rozliczeń i limitów wykorzystania.
Token OAuth w nagłówku Authorization żądania. Więcej informacji o używaniu OAuth z interfejsem Maps Datasets API znajdziesz w artykule Używanie OAuth.
Numer lub identyfikator projektu Google Cloud w adresie URL żądania. Ta wartość określa projekt zawierający zbiór danych. Chociaż ten projekt jest zwykle taki sam jak projekt określony w nagłówku X-Goog-User-Project, nie musi być taki sam.
Identyfikator zbioru danych w adresie URL żądania. Za każdym razem, gdy wykonujesz działanie na konkretnym zbiorze danych, przekazujesz identyfikator zbioru danych w ramach adresu URL żądania.
Numer projektu i identyfikator projektu są widoczne w sekcji Informacje o projekcie na ekranie przeglądu.
Uzyskiwanie tokena OAuth
Aby uwierzytelnić żądanie interfejsu API, musisz umieścić w nagłówku Authorization token OAuth. Więcej informacji znajdziesz w artykule Używanie OAuth.
Aby wygenerować token, użyj na przykład tego polecenia gcloud:
Możesz umieścić polecenie gcloud bezpośrednio w nagłówku Authorization w poleceniu cURL, aby generować nowy token przy każdym żądaniu, jak pokazano w przykładzie powyżej.
Możesz też ustawić zmienną środowiskową zawierającą token, a następnie przekazać ją w ramach żądania:
[[["Łatwo zrozumieć","easyToUnderstand","thumb-up"],["Rozwiązało to mój problem","solvedMyProblem","thumb-up"],["Inne","otherUp","thumb-up"]],[["Brak potrzebnych mi informacji","missingTheInformationINeed","thumb-down"],["Zbyt skomplikowane / zbyt wiele czynności do wykonania","tooComplicatedTooManySteps","thumb-down"],["Nieaktualne treści","outOfDate","thumb-down"],["Problem z tłumaczeniem","translationIssue","thumb-down"],["Problem z przykładami/kodem","samplesCodeIssue","thumb-down"],["Inne","otherDown","thumb-down"]],["Ostatnia aktualizacja: 2025-09-12 UTC."],[[["\u003cp\u003eAll Maps Datasets API requests require a Google Cloud project number or ID for billing and usage quota, specified in the \u003ccode\u003eX-Goog-User-Project\u003c/code\u003e header or using a service account.\u003c/p\u003e\n"],["\u003cp\u003eAn OAuth token is necessary for authentication and should be included in the \u003ccode\u003eAuthorization\u003c/code\u003e header of each request.\u003c/p\u003e\n"],["\u003cp\u003eThe request URL must contain the Google Cloud project number or ID and the dataset ID to specify the location of the dataset.\u003c/p\u003e\n"],["\u003cp\u003eAdditional parameters may be required for certain requests, as detailed in the specific request documentation.\u003c/p\u003e\n"],["\u003cp\u003eYou can obtain your Google Cloud project number or ID from the project's Overview page in the Cloud Console and generate an OAuth token using the \u003ccode\u003egcloud\u003c/code\u003e command.\u003c/p\u003e\n"]]],["To interact with the Maps Datasets API, requests must include: the Google Cloud project number or ID in the `X-Goog-User-Project` header for billing and quota (unless using a service account); an OAuth token in the `Authorization` header; the project number or ID in the URL; and the dataset ID in the URL. The project number and ID can be found on the project's overview page. An OAuth token can be generated using the `gcloud auth application-default print-access-token` command.\n"],null,[]]