Authenticate oauth2 with test account

28 views
Skip to first unread message

Meir Cohen

unread,
Jun 30, 2017, 10:04:57 AM6/30/17
to AdWords API Forum
Hi, 

I created MCC test account, then inside I created a new test account and associated it to a new gmail account email address. 

Next, I generated clientId and clientSecret and by using the code samples from googleads-php-lib I was able to write a simple web page with a button, click on the button opens your authentication page which shows all the google accounts I own. In this page I try to log into the new test account that I created under the MCC test account but I get this exception: 

AuthorizationError.USER_PERMISSION_DENIED

Please suggest how to proceed from here. I am trying to make a successful connection to the API and get campaigns, ads etc.

Thanks.

Shwetha Vastrad (AdWords API Team)

unread,
Jun 30, 2017, 1:44:16 PM6/30/17
to AdWords API Forum
Hi, 

This error occurs when there is no link between the manager account authenticated in the request and the client account specified in the headers. You need to use CustomerService.getCustomers() to get the list of AdWords accounts directly access by your OAuth2 credentials and then ManagedCustomerService to determine which client accounts are linked to your manager account.

If this doesn't work, please provide the SOAP request and response logs and the email address used to generate the refresh token. Please use Reply privately to author when responding. 

Thanks,
Shwetha, AdWords API Team.
Reply all
Reply to author
Forward
0 new messages