To make any request to Maps Datasets API, you must include:

- 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.

  > [!NOTE]
  > **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).

- An OAuth token in the `Authorization` header of the request. For more
  information about using OAuth with Maps Datasets API, see
  [Use OAuth](https://developers.google.com/maps/documentation/datasets/oauth-token).

- A Google Cloud project number or ID in the request URL. This value
  specifies the project containing the dataset. 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 dataset ID in the request URL. Whenever you perform an action on a
  specific dataset, you pass the ID of the dataset as part of the request URL.

> [!NOTE]
> **Note:** Some requests require additional parameters that are described in the documentation on those requests.

For example, to delete a dataset:

```
curl -X DELETE \
-H 'X-Goog-User-Project: PROJECT_NUMBER_OR_ID' \
-H "Authorization: Bearer $(gcloud auth application-default print-access-token)" \
https://mapsplatformdatasets.googleapis.com/v1/projects/PROJECT_NUMBER_OR_ID/datasets/DATASET_ID
```

## Get the project number

To get the <var translate="no">PROJECT_NUMBER_OR_ID</var> of your Google Cloud project:

1. Go to the project's
   [Overview page](https://console.cloud.google.com/home/dashboard)
   in the 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.

## Get an OAuth token

> [!NOTE]
> **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.

For authentication, your API request must contain an OAuth token in the
`Authorization` header. For more, see [Use OAuth](https://developers.google.com/maps/documentation/datasets/oauth-token).

For example, use the following `gcloud` command to generate the token:

```
gcloud auth application-default print-access-token
```

You can include the `gcloud` command directly in the `Authorization` header in a
cURL command to generate a new token on each request, as shown in the example
above.

Alternatively, you can set an environment variable containing the token and then
pass the environment variable as part of the request:

    export TOKEN=$(gcloud auth application-default print-access-token)
    curl -X DELETE \
    -H 'X-Goog-User-Project: PROJECT_NUMBER_OR_ID' \
    -H "Authorization: Bearer $TOKEN" \
    https://mapsplatformdatasets.googleapis.com/v1/projects/PROJECT_NUMBER_OR_ID/datasets/DATASET_ID