Google Apps Script: DoubleClickCampaigns.UserProfiles.list() "Failed with error = null"

190 views
Skip to first unread message

Marco Schierhorn

unread,
Apr 21, 2022, 9:41:08 AM4/21/22
to Google Apps Script Community
Hi Google Apps Script Support Forum,

I'm currently trying to get the API working in Google Apps Script.
But when I execute the following code:

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

if (profiles.items) {
// Print out the user ID and name of each
for (let i = 0; i < profiles.items.length; i++) {
const profile = profiles.items[i];
Logger.log('Found profile with ID %s and name "%s".',
profile.profileId, profile.userName);
}
}
} catch (e) {
// TODO (Developer) - Handle exception
Logger.log('Failed with error: %s', e.error);
}
}

I always get this error "Failed with error: null". It's hard to debug it, as it seems that the API Call directly fails. I have also activated the CM360 API in the Google project.
And another questions is, can I also use a service account with the Google Apps Script Service "DoubleClickCampaigns"? 

Thanks,
Marco
Reply all
Reply to author
Forward
0 new messages