Introducing DCM Reporting and Trafficking Services in Apps Script

Starting today, the DCM/DFA Reporting and Trafficking API is available as an advanced Google service in Google Apps Script. This service allows users to easily integrate their DCM reporting and trafficking data with Google Docs and Sheets, schedule updates using triggers, and much more.

Accessing the API from Apps Script is simple: just enable the service and it's ready to use. Authentication is handled automatically and editor conveniences such as autocomplete make it easy to start writing code right away. As an example, here's a snippet of code that shows how to list all user profiles available to your Google account:

function listUserProfiles() {
// Retrieve the list of available user profiles
var profiles = DoubleClickCampaigns.UserProfiles.list();

if (profiles.items) {
// Print out the user ID and name of each
for (var i = 0; i < profiles.items.length; i++) {
var profile = profiles.items[i];
Logger.log('Found profile with ID %s and name "%s".',
profile.profileId, profile.userName);
}
}
}
To get started, check out the service documentation, which contains additional examples, as well as the full API reference documentation. If you have any questions, visit the API forum or reach out to Google Apps Script support.