Getting all campaigns from campaignService across all accounts under management account

261 views
Skip to first unread message

Joseph Ercole

unread,
Apr 11, 2017, 9:58:46 PM4/11/17
to AdWords API Forum, Charles Baldridge
Hi, 

I just want to make sure I'm not going overboard with the solution to this.

I'm trying to figure out how to get the list of campaigns for all accounts under my management account.

Based on what I'm seeing in the documentation, it seems like I need to do something along the lines of what's in the "get_account_hierarchy.py" example, and then for each customerId that comes back, pull the campaigns from the campaign service.

Is that the expectation? Or is there a way that for each service you could just ask for all entities under the management account for that service (i.e. all campaigns).

Thanks in advance,
Joe

Ivan Bautista

unread,
Apr 12, 2017, 2:11:45 AM4/12/17
to AdWords API Forum, cbald...@mywebgrocer.com
Hi Joe,

Yes, that's correct. Every API service such as CampaignService can only be executed on a per account basis and not for multiple accounts so you need to have separate API calls for every account you want to pull entities from such as campaigns. 

The getAccountHierarchy sample code you referred to earlier for getting the list of clientCustomerId is a good starting reference for your development. After which, you can execute separate API calls for each clientCustomerId as you've mentioned.

In addition, you may refer to this guide as reference for programmatically changing the clientCustomerId on runtime.

Regards,
Ivan
AdWords API Team

Reply all
Reply to author
Forward
0 new messages