Keith
Keith

Reputation: 5391

Google AdWords API: access with service account

I am trying to build my first app that pulls campaign data from AdWords, but I am having a bit of trouble. Here is where I'm at:

  1. Installed the AdWords API NuGet package
  2. Created an MCC Test account and an AdWords Test account
  3. Created an AdWords API developer account (on LIVE adwords account)
  4. Created a Project, as well as a Service Account within my test account in the Google Developers Console.
  5. Wired up my Web.config with the Service Account OAuth credentials/p12 file location.

When I run the app, I get the following response:

Failed to get access token for service account.
{
 "error" : "access_denied",
 "error_description" : "Requested scopes not allowed: https://adwords.google.com/api/adwords/"
}

Since AdWords isn't an option in the "APIs" tab in Google Developers Console project, I'm not sure where to go.

The documentation (here: https://developers.google.com/adwords/api/docs/guides/service-accounts) says to go to https://www.google.com/a/cpanel/YOUR_DOMAIN/ManageOauthClients and replace YOUR_DOMAIN with your domain, however I don't have a domain necessarily. Note that I'm not that familiar with AdWords, so it's possible I'm missing something obvious, but I really didn't set up a domain with my test account. Also, I tried to go through My Account => Preferences => API to see if setting up a Developer Token on the test side would help, but it appears you need a real CC# to continue, and the response here mentions that Test Developer Tokens don't work: https://groups.google.com/forum/#!topic/adwords-api/EChRX1RFaUk.

Any suggestions are greatly appreciated. The Google documentation is awful, and I am going dizzy, what with all the going around in circles I've been doing.

Upvotes: 3

Views: 2648

Answers (2)

Foozinator
Foozinator

Reputation: 400

I have the same problem. My working AdWords service app started getting errors: "You are accessing an AdWords API version v201409 that has been discontinued." Each year, I have to learn a new method of Google security, and they chose when and have really lousy documentation. I don't have time to spend 2 days learning a nifty new security paradigm. I just want my program to download reports!

Upvotes: 2

wafflecat
wafflecat

Reputation: 557

Sounds like you're having trouble with OAuth2, and it would be a good idea to cross post this question to that stock overflow category.

A service account with OAuth2 & Google means that you have a Google Apps domain (for example, your company uses enterprise gmail & docs). Most people will be using credentials for an installed app or web app.

Check out Google's Adwords API Workshop videos on using OAuth2: http://www.youtube.com/watch?v=xjaJMagip5s&list=PLKByxjzUC-N_yESo9Ke25eiPC3Gw4bbsL&index=3

And if you'd like to understand OAuth2 more in depth, check out the OAuth2 playground: https://developers.google.com/oauthplayground/

Upvotes: -1

Related Questions