The DCM/DFA Reporting and Trafficking API provides programmatic access to information from your DoubleClick Campaign Manager (DCM) account. It's used to manage and create campaigns and reports, just as you would through the DCM and Report Builder web services.
This guide describes how to get started with the DCM/DFA Reporting and Trafficking API.
Before using the DCM/DFA Reporting and Trafficking API, there are a few prerequisite steps you'll need to satisfy:
- You must have a DCM account. See Advertisers/Agencies for signup information.
- Your DCM account must be enabled for API Access. Contact your DoubleClick representative or the DCM support team for assistance.
- You must have a user profile with access to this account. Have your DCM account administrator create a user profile associated with this account.
Creating a project
To get started using the DCM/DFA Reporting and Trafficking API, you need to first create or select a project in the Google API Console and enable the API. Using this link guides you through the process and activates the DCM/DFA Reporting and Trafficking API automatically.
The following steps apply to users who have an existing project and prefer to activate the DCM/DFA Reporting and Trafficking API for it manually.
To enable an API for your project, do the following:
- Open the API Library in the Google API Console. If prompted, select a project or create a new one. The API Library lists all available APIs, grouped by product family and popularity.
- If the API you want to enable isn't visible in the list, use search to find it.
- Select the API you want to enable, then click the Enable button.
- If prompted, enable billing.
- If prompted, accept the API's Terms of Service.
All requests you make to the DCM/DFA Reporting and Trafficking API must include an access token, which identifies your application to Google and controls your access to the various services offered by the API.
For more details about access and authorization, refer to the Authorize Requests guide.
Tip: You can visit the OAuth 2.0 Playground to explore authorization concepts interactively.
Setting up OAuth 2.0
To make authorized requests from your application, you need an OAuth 2.0 client ID, which your application uses when requesting an OAuth 2.0 access token. The following instructions guide you through the process of creating an OAuth 2.0 client ID to use with the installed application flow. For instructions on generating credentials for use with the service account flow, refer to the Service Accounts guide.
- Follow the steps to configure a Google API Console project.
- Open the Credentials page in the API Console.
- Click Create credentials > OAuth client ID.
- Select Other when prompted to select an application type and enter any additional required information.
- If this is your first time creating a client ID, besides being able to select your application type, you can configure your consent screen by clicking the Configure consent screen button. You will not get a prompt to configure your consent screen again after you do it the first time, although this information can be updated at any time.
- Click Create.
When finished, you'll be presented with a client ID and client secret that your application can use to generate an OAuth 2.0 access token. You may optionally choose to download this information in JSON format.
When you use OAuth 2.0 for authentication, your users are authenticated after they agree to terms presented to them on a user consent screen.
To set up your project's consent screen, do the following:
- Open the Consent Screen page in the Google API Console. If prompted, select a project or create a new one.
- Fill out the form and click Save.
Finding sample code
Links to sample code are available on the Client Libraries page. To use these samples, follow the steps in the authorization guide to register your application with Google.
Ready to start making requests? Here are some of the more common actions you might need to take.
Tip: The API Reference includes an embedded API Explorer on every method detail page. Use these embedded explorers to test API calls.
- Not sure what your user profile ID is? Look it up with a request to UserProfiles.list.
- Refer to the common trafficking tasks guide.