Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
Para realizar cualquier solicitud a la API de Maps Datasets, debes incluir lo siguiente:
El número o ID de tu proyecto de Google Cloud en el encabezado X-Goog-User-Project de la solicitud. Este valor determina el proyecto que se usa para los cálculos de facturación y cuota de uso.
Un token de OAuth en el encabezado Authorization de la solicitud. Para obtener más información sobre el uso de OAuth con la API de Maps Datasets, consulta Usa OAuth.
Es el ID o número de un proyecto de Google Cloud en la URL de la solicitud. Este valor especifica el proyecto que contiene el conjunto de datos. Si bien este proyecto suele ser el mismo que el especificado en el encabezado X-Goog-User-Project, no es obligatorio que lo sea.
Es el ID del conjunto de datos en la URL de la solicitud. Cada vez que realizas una acción en un conjunto de datos específico, pasas el ID del conjunto de datos como parte de la URL de la solicitud.
Por ejemplo, para borrar un conjunto de datos, haz lo siguiente:
El Número de proyecto y el ID del proyecto aparecen en el área Información del proyecto de la pantalla de descripción general.
Obtén un token de OAuth
Para la autenticación, tu solicitud a la API debe contener un token de OAuth en el encabezado Authorization. Para obtener más información, consulta Usa OAuth.
Por ejemplo, usa el siguiente comando gcloud para generar el token:
Puedes incluir el comando gcloud directamente en el encabezado Authorization de un comando cURL para generar un token nuevo en cada solicitud, como se muestra en el ejemplo anterior.
Como alternativa, puedes establecer una variable de entorno que contenga el token y, luego, pasar la variable de entorno como parte de la solicitud:
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Falta la información que necesito","missingTheInformationINeed","thumb-down"],["Muy complicado o demasiados pasos","tooComplicatedTooManySteps","thumb-down"],["Desactualizado","outOfDate","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Problema con las muestras o los códigos","samplesCodeIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2025-09-03 (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,["# Required request parameters\n\nTo make any request to Maps Datasets API, you must include:\n\n- The number or ID of your Google Cloud project in the\n `X-Goog-User-Project` header of the request. This value determines the\n 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 Google](https://cloud.google.com/docs/authentication).\n- An OAuth token in the `Authorization` header of the request. For more\n information about using OAuth with Maps Datasets API, see\n [Use OAuth](/maps/documentation/datasets/oauth-token).\n\n- A Google Cloud project number or ID in the request URL. This value\n specifies the project containing the dataset. While this project is usually\n the same as the project specified in the `X-Goog-User-Project` header, it\n is not required to be the same.\n\n- The dataset ID in the request URL. Whenever you perform an action on a\n specific dataset, you pass the ID of the dataset as part of the request URL.\n\n| **Note:** Some requests require additional parameters that are described in the documentation on those requests.\n\nFor example, to delete a dataset: \n\n```\ncurl -X DELETE \\\n-H 'X-Goog-User-Project: \u003cvar translate=\"no\"\u003ePROJECT_NUMBER_OR_ID\u003c/var\u003e' \\\n-H \"Authorization: Bearer $(gcloud auth application-default print-access-token)\" \\\nhttps://mapsplatformdatasets.googleapis.com/v1/projects/PROJECT_NUMBER_OR_ID/datasets/DATASET_ID\n```\n\nGet the project number\n----------------------\n\nTo get the \u003cvar translate=\"no\"\u003ePROJECT_NUMBER_OR_ID\u003c/var\u003e of your Google Cloud project:\n\n1. Go to the project's\n [Overview page](https://console.cloud.google.com/home/dashboard)\n in the 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.\n\nGet an OAuth token\n------------------\n\n| **Note:** The procedure below to generate an OAuth token is not intended for use in a production environment. Use this procedure for a development or testing environment only.\n\nFor authentication, your API request must contain an OAuth token in the\n`Authorization` header. For more, see [Use OAuth](/maps/documentation/datasets/oauth-token).\n\nFor example, use the following `gcloud` command to generate the token: \n\n```\ngcloud auth application-default print-access-token\n```\n\nYou can include the `gcloud` command directly in the `Authorization` header in a\ncURL command to generate a new token on each request, as shown in the example\nabove.\n\nAlternatively, you can set an environment variable containing the token and then\npass the environment variable as part of the request: \n\n export TOKEN=$(gcloud auth application-default print-access-token)\n curl -X DELETE \\\n -H 'X-Goog-User-Project: \u003cvar translate=\"no\"\u003ePROJECT_NUMBER_OR_ID\u003c/var\u003e' \\\n -H \"Authorization: Bearer $TOKEN\" \\\n https://mapsplatformdatasets.googleapis.com/v1/projects/\u003cvar translate=\"no\"\u003ePROJECT_NUMBER_OR_ID\u003c/var\u003e/datasets/\u003cvar translate=\"no\"\u003eDATASET_ID\u003c/var\u003e"]]