Overview

  • The Authorized Buyers Marketplace API, specifically the curators.dataSegments resource, is used to create and manage data segments.

  • Accessing the Marketplace API requires setting up authentication using the OAuth 2.0 protocol and creating a Service Account in Google Cloud.

  • You must enable the Authorized Buyers Marketplace API in your Google Cloud project and download a JSON key for your service account to make API calls.

  • Data segments are identified differently in the Marketplace API (using a resource name) compared to Real-time Curation (using the data segment ID).

You can create and manage data segments using the Authorized Buyers Marketplace API, which exposes a curators.dataSegments resource. This is a REST API with generated client libraries that you can use for your integration.

Set up authentication

Google APIs use the OAuth 2.0 protocol for authentication and authorization. Here's how to set up a Service Account to access Marketplace API.

  1. If you have not done so already, create a Google Cloud Project that hosts your credentials used to access the API.
  2. Go to the Google Cloud Console Enabled APIs page. Select the project you created earlier.
  3. You see a list of enabled APIs and services. To access Marketplace API, you must enable it. If Marketplace API isn't enabled, click +Enable APIs and services and step through the following instructions:

    1. You are directed to a page with a search box. Search for Authorized Buyers Marketplace API.
    2. Select Authorized Buyers Marketplace API in the results page.
    3. Click Enable.
  4. On the navigation menu, select Credentials.
  5. Click +Create credentials, and in the resulting drop-down menu select Service account.
  6. Enter a Name for the service account. The Service account ID is created automatically upon creation – note this value because it will be needed later in step 14. Optionally enter a description. Click Create and continue.
  7. Optionally configure permissions for the service account and click Continue.
  8. Optionally configure users or groups that can perform actions as the service account and click Done.
  9. Your new service account is listed under Service Accounts. Find and click the service account ID you just created.
  10. Click the Keys tab.
  11. In the Add key drop-down menu, select Create new key.
  12. Select JSON as the Key type, and click Create.
  13. Download the key to your working directory. For more information about storing your key securely, see Managing service account keys. The key is used by your application to make API calls.
  14. Share the service account ID with your Technical Account Manager to link the service account with your account.

API scopes

When stepping through the OAuth 2.0 flow to receive an access token used to make an API call, you must specify the APIs that can be accessed using that token. For the Authorized Buyers Marketplace API, that scope is https://www.googleapis.com/auth/authorized-buyers-marketplace.

How to identify data segments in the API versus Real-time Curation

In Marketplace API, data segments are identified with an API-specific resource name such as:

"curators/[YOUR_ACCOUNT_ID]/dataSegments/[DATA_SEGMENT_ID]".

When identifying the data segments relevant for an ad opportunity in Real-time Curation, specify the value for the DATA_SEGMENT_ID resource ID rather than the full resource name used by the API.

Next Steps