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:
If you don't already have a Google Account, create one.
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.
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.
Create a Google API Console project and OAuth credentials for your client
- Start the Google API Console
The setup tool guides you through creating a project (or using an existing project), enabling the DoubleClick Search API, and creating OAuth 2.0 credentials.
- On the Register your application page, select an existing project or select Create a project. Then click Continue.
- After the Google API Console enables the DoubleClick Search API, click the Go to credentials button.
- On the Add credentials to your project page, enter the following information:
- Which API are you using?: DoubleClick Search API
- Where will you be calling the API from?: Other UI (e.g., Windows, CLI tool)
- What data will you be accessing?: User data
- Click the What credentials do I need? button.
The setup tool now offers to help you create an OAuth 2.0 client ID.
- Click Create client ID and follow the rest of the steps in the setup tool.
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:
Learn REST basics
There are two ways to invoke the API:
- Using client libraries.
- Sending HTTP requests and parsing the responses.
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
DELETE. It specifies a resource by a globally-unique URI of the following form:
Because all API resources have unique HTTP-accessible URIs, REST enables data caching and is optimized to work with the web's distributed infrastructure.
You may find the method definitions in the HTTP 1.1 standards documentation useful; they include specifications for
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:
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.