To start using the API, complete the following steps:

1. Log into or create a Google Cloud Console account
2. In the Google Cloud Console, select or create a project.
3. Enable the MMM Data API
4. Create a service account for the new project following [these instructions](https://cloud.google.com/iam/docs/service-accounts-create).
5. Link the service account to your MMM Data Platform account in the MMM Data Platform UI.

## Enable the API

    gcloud services enable mmmdata.googleapis.com

## Link service accounts to MMM Data Platform

> [!NOTE]
> **Note:** This has to be done by a user with "Owner" access to MMM Data Platform.

1. Click the "cog" icon on the right side of the header and select 'API service
   accounts'.

   ![Open API service accounts](https://developers.google.com/static/mmm-data-platform/images/api/api_linking_service_account_cog.png)
2. Click "New service account".

   ![Click New Service Account](https://developers.google.com/static/mmm-data-platform/images/api/new_service_account.png)
3. Enter the service account details from your Google Cloud project and select the access level.

   ![Enter service account details](https://developers.google.com/static/mmm-data-platform/images/api/service_account_details.png)
4. Copy the MMM Data Platform Account ID and use it in your API requests.

   ![Copy the MMM Data Platform Account ID](https://developers.google.com/static/mmm-data-platform/images/api/mmm_dp_account_id.png)

## Make the first request

1. Install the Google Cloud CLI (see [instructions](https://cloud.google.com/sdk/docs/install-sdk))
2. Ensure that you are signed into the gcloud CLI (see [instructions](https://cloud.google.com/docs/authentication/gcloud)
   for more details).

       gcloud init

3. Generate the OAuth Token using the previously linked service account
   ('test-account@yourproject.iam.gserviceaccount.com' in the previous example,
   see [instructions](https://cloud.google.com/iam/docs/create-short-lived-credentials-direct#create-access))

       OAUTH_TOKEN=$(gcloud auth \
       --impersonate-service-account=YOUR_SERVICE_ACCOUNT print-access-token \
       --scopes=https://www.googleapis.com/auth/mmm_data.readonly)

4. Make a call to the API using the MMM Data Platform Account ID:

       curl -H "Authorization: Bearer $OAUTH_TOKEN" \
       -H "Content-type: application/json" \
       "https://mmmdata.googleapis.com/v0/accounts/YOUR_MMM_DATA_PLATFORM_ACCOUNT_ID/projects"