USER_PERMISSION_DENIED when making first request

95 views
Skip to first unread message

Bernard Pace

unread,
Dec 14, 2015, 8:58:24 AM12/14/15
to AdWords API Forum, Gilbert Zammit
Hi,

I'm new to the Adwords API and just trying to do my first request using C#.

I downloaded the sample code provided online and is writing a small console application following the tutorial available in the following link: https://developers.google.com/adwords/api/docs/first-request?hl=en#dotnet

I have arrived at Step 4, but an exception is being raised on the following line of code
BudgetReturnValue budgetRetval = budgetService.mutate(new BudgetOperation[] { budgetOperation });

The exception being raised is the following:
{"[AuthorizationError.USER_PERMISSION_DENIED @ ; trigger:'<null>']"}

The configuration settings within the App.config file should be well configured.  Below are some details on the procedure I have taken to get these settings.
DeveloperToken - has been extracted from the Adwords API Center and has its access level set to Test Accounts
ClientCustomerId - This has been copied from my personal account from the Google AdWords Manager page
AutorizationMethod - OAuth2
OAuth2ClientId - This has been generated from the Google Developers Console.  I set up a new project and created a new set of credentials (OAuth Client ID) and application type set as other.  Prior to this step I set up OAuth consent screen (fields populated: Email address and Product name shown to users)
OAuth2ClientSecret - This has been generated from the Google Developers Console.  I set up a new project and created a new set of credentials (OAuth ClientID) and application type set as other (same step as above)
OAuth2RefreshToken - I have used the sample application OAuthTokenGenerator downloaded from the sample code.  The parameter values used are the ones as extracted from the steps just described above (OAuth2ClientId, OAuth2ClientSecret, selected option 'AdWords API') and granted access to the Product name created in the OAuth consent screen above

Any ideas in what I'm missing?


Thanks in Advance,
Bernard

Yin Niu

unread,
Dec 14, 2015, 11:47:54 AM12/14/15
to AdWords API Forum, gi...@upmargin.com
Hello,

The AuthorizationError.USER_PERMISSION_DENIED means your OAuth credentials don't match clientCustomerId you specify. Basically, login you are using doesn't have access to the account you are trying to touch. BTW, this is covered here. Please re-do the OAuth flow (generate new refresh token) making sure you are logged in under a proper account(MCC account owner). Please check out OAuth2.0 .NET guide for more details. Please let us know if the issue is not resolved.

Regards,
Yin, AdWords API Team.
Reply all
Reply to author
Forward
0 new messages