Initial setup

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.
  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
  1. Click the "cog" icon on the right side of the header and select 'API service accounts'.

    Open API service accounts

  2. Click "New service account".

    Click New Service Account

  3. Enter the service account details from your Google Cloud project and select the access level.

    Enter service account details

  4. Copy the MMM Data Platform Account ID and use it in your API requests.

    Copy the MMM Data Platform Account ID

Make the first request

  1. Install the Google Cloud CLI (see instructions)
  2. Ensure that you are signed into the gcloud CLI (see instructions 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)

    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"