The Wayback Machine - https://web.archive.org/web/20160502095802/https://developers.google.com/doubleclick-search/v2/prereqs

Your First App: Prerequisites

Before you can start coding your first client application, there are a few things you need to do, if you haven't done them already.

Create a Google Account and get DS permissions

To use the DoubleClick Search API, you need a Google Account and appropriate permissions granted to that account from DoubleClick Search:

  1. If you don't already have a Google Account, create one.

  2. Ask a DoubleClick Search Agency Manager to create a DoubleClick Search user for your Google Account.

    To download reports, you'll need view permission for the advertisers you'll be working with.

    To add or edit conversions, you'll need edit permission for the advertisers you'll be working with.

    The Agency Manager can set up your account as an Advertiser user with access to specific advertisers, or set up your account with a higher level of access such as Agency user with access to all advertisers in the agency.

Create a project for your client

Before you can send requests to DoubleClick Search, you need to tell Google about your client and activate access to the API. You do this by using the Google Developers Console to create a project , which is a named collection of settings and API access information.

To get started using DoubleClick Search API, you need to first create or select a project in the Google Developers Console and enable the API. Using this link guides you through the process and activates the DoubleClick Search API automatically.

Alternatively, you can activate the DoubleClick Search API yourself in the Developers Console by doing the following:

  1. Open the Credentials page.

In either case, you end up on the Credentials page and can create your project's credentials from here.

From the Credentials page, click Add credentials > OAuth 2.0 client ID to create your OAuth 2.0 credentials or Add credentials > Service account to create a service account.

Next, if you created an OAuth 2.0 client ID, select your application type.

Your application's client IDs are now listed. You can click each client ID for details; parameters vary depending on the ID type, but might include email address, client secret, JavaScript origins, and redirect URIs.

Activate the API Conversion Service

If you want to upload data about conversions, a DoubleClick Search user with Agency Manager privileges needs to sign in to the DoubleClick Search UI and activate the API conversion service. See the DoubleClick Search help center for instructions.

Install dsApi.py

DoubleClick Search provides a utility script to facilitate the process of setting up authorization. You can also use this script to send and receive data in the JSON format, if you want to try sending and receiving data before you design and write a full application. You can copy many of the JSON examples in this documentation site and input them directly to the script.

To install the script:

  1. Install Python 2.7 or better.
  2. Install cURL.
  3. Download dsApi.zip.
  4. Extract dsApi.py from dsApi.zip.
  5. Make dsApi.py executable.

Learn REST basics

There are two ways to invoke the API:

If you decide not to use client libraries, you'll need to understand the basics of REST.

REST is a style of software architecture that provides a convenient and consistent approach to requesting and modifying data.

The term REST is short for "Representational State Transfer." In the context of Google APIs, it refers to using HTTP verbs to retrieve and modify representations of data stored by Google.

In a RESTful system, resources are stored in a data store; a client sends a request that the server perform a particular action (such as creating, retrieving, updating, or deleting a resource), and the server performs the action and sends a response, often in the form of a representation of the specified resource.

In Google's RESTful APIs, the client specifies an action using an HTTP verb such as POST, GET, PUT, or DELETE. It specifies a resource by a globally-unique URI of the following form:

https://www.googleapis.com/apiName/apiVersion/resourcePath?parameters

Because all API resources have unique HTTP-accessible URIs, REST enables data caching and is optimized to work with the web's distributed infrastructure.

For more information about REST, you may find the following third-party documents useful:

REST in the DoubleClick Search API

The DoubleClick Search API operations map directly to REST HTTP verbs.

The specific format for DoubleClick Search API URIs is:

https://www.googleapis.com/doubleclick-search/v2/resourcePath?parameters

The full set of URIs used for each supported operation in the API is summarized in the API Reference.

Learn JSON basics

If you use REST, you'll need to use the JSON format for the request bodies. You can specify that the responses be either in the JSON or CSV format.

JSON (JavaScript Object Notation) is a common, language-independent data format that provides a simple text representation of arbitrary data structures. For more information, see json.org.

Send feedback about...

DoubleClick Search API