AdWords Scope?

1,317 views
Skip to first unread message

Richard Moran

unread,
Dec 19, 2014, 12:10:44 PM12/19/14
to adwor...@googlegroups.com
I'm trying to follow this example of implementing OAuth (https://developers.google.com/api-client-library/dotnet/guide/aaa_oauth#web_applications) and I can successfully perform a log in and get access to the various user properties using the "https://www.googleapis.com/auth/plus.login" scope. What scope do I need to use in order to be able to get a list of the logged in user's AdWords client accounts and then post campaigns/AdGroups etc on their behalf? I've found some references to "https://adwords.google.com/api/adwords/" but that URL returns a 404. Similarly, the OAuth playground (https://developers.google.com/oauthplayground/) doesn't have any references to AdWords.

Assuming there is a scope, what would it be? If there isn't a scope, how do I get all the information and permissions I require? I don't want to use an MCC as this adds too many steps and too much admin, I just want to be able to get the information from the logged in user and post on their behalf.

Josh Radcliff (AdWords API Team)

unread,
Dec 19, 2014, 1:06:38 PM12/19/14
to adwor...@googlegroups.com
Hi,

You may want to go through our entire OAuth guide for more details, but the OAuth scope for the AdWords API is documented in this section.

Once you have a user's OAuth credentials for that scope, you can use CustomerService.get and grab the customerId from the returned Customer object. You can then use that customerId to set the clientCustomerId SOAP header in your API requests.

Cheers,
Josh, AdWords API Team

Richard Moran

unread,
Dec 22, 2014, 9:21:54 AM12/22/14
to adwor...@googlegroups.com
Brilliant, I've managed to get all that working so far. The problem I'm having now though comes when the logged-in user is an MCC user. In that instance, the customer I want to add the campaign to is not their MCC customer, it's one of their "account" customers. How do I get a list of all their "account" customers? I can't see any "account" services. Also, how can I tell if the logged in user is an MCC customer or just a standard AdWords customer?

Josh Radcliff (AdWords API Team)

unread,
Dec 22, 2014, 9:40:07 AM12/22/14
to adwor...@googlegroups.com
Hi,

On all services except CustomerService, you must specify which account you want each API request to act upon by setting the clientCustomerId SOAP header. On CustomerService, that header is optional (see below).

To get the list of all accounts under an MCC you can use ManagedCustomerService. The .NET client library's GetAccountHierarchy.cs contains an example of how to do this.

To determine the type of customer, simply set the clientCustomerId header on a CustomerService.get request, and then check the canManageClients field, which will be true for an MCC, and false for a regular AdWords account. Note that if you do not specify clientCustomerId on a CustomerService call, it will simply return a Customer object that reflects the MCC or AdWords account associated with the request's OAuth credentials.

Cheers,
Josh, AdWords API Team

Richard Moran

unread,
Dec 22, 2014, 10:15:04 AM12/22/14
to adwor...@googlegroups.com
Aha! That looks like a winner to me. Thanks a lot Josh.

Marcos Gil Fuertes

unread,
Aug 7, 2019, 6:36:36 PM8/7/19
to AdWords API and Google Ads API Forum
That link doesn't work anymore :(

Google Ads API Forum Advisor Prod

unread,
Aug 8, 2019, 12:59:41 AM8/8/19
to adwor...@googlegroups.com
Hi Marcos,

Thanks for your reply in this thread.

However, since this thread is old already, you can make a new post on this forum so that we can better track your concern. Also, please elaborate the issue and provide more details in the new forum post.

Regards,
Ejay
Google Ads API Team

ref:_00D1U1174p._5001UEIJ5r:ref
Reply all
Reply to author
Forward
0 new messages