Authenication credentials

41 views
Skip to first unread message

peter.n...@etraveli.com

unread,
Jul 5, 2018, 1:56:33 AM7/5/18
to AdWords API and Google Ads API Forum
We are download statistics daily using ReportDownloader. But, since mid may this stopped working due to bad credentials it seems. We get USER_PERMISSION_DENIED for all our clientIds. We have not changed our authentication credentials at all, but one night this stopped working.

I asked AdWords support, but was eventually directed here. After searching and reading other questions and posting I realised that I should try verify using the getCustomers() for the AdWordsServices.

    AdWordsSession session = createAdWordsSession(clientId, clientSecret, refreshToken, developerToken, userAgent);
    AdWordsServicesInterface adWordsServices = AdWordsServices.getInstance();
    CustomerServiceInterface service = adWordsServices.get(session, CustomerServiceInterface.class);
    for (Customer customer : service.getCustomers()) {
      System.out.printf("  %s%n", customer.getCustomerId());
    }

But, I get AuthenticationError CUSTOMER_NOT_FOUND as fault. If I add the .withClientCustomerId() when I create the session I get USER_PERMISSION_DENIED as expected.

So, can help us to get the right credentials (this was setup four-five years ago and the knowledge has left the building :)). Is it here or calling our sales contact? Or is it the AdWords support? 

Best regards,
Peter

Ps
This might be posted twice, but I could not find so I am posting a new question.
Ds.

Dannison Yao (AdWords API Team)

unread,
Jul 5, 2018, 3:21:53 AM7/5/18
to adwor...@googlegroups.com
Hi Peter,

The error USER_PERMISSION_DENIED is encountered when there is no link between the MCC account and the client account or that you may be using OAuth2 credentials that does not have access to the account you're making the calls against. 

In your scenario, it is most likely that the OAuth2 credentials you are using no longer have access to your accounts. To resolve this, I would recommend that you regenerate them by referring to this guide. After you have done so, you can retry your report request. Let me know if this works for you. If the issue persists, could you provide your clientCustomerId and the complete SOAP request and response logs (via reply privately to author)?

Regards,
Dannison
AdWords API Team

peter.n...@etraveli.com

unread,
Jul 5, 2018, 8:51:47 AM7/5/18
to AdWords API and Google Ads API Forum
Hi, and thanks for the reply. I regenerated the clientId, clientSecret and refreshtoken and now it works. The developerToken and the connected clientIds was still valid for our account.

I now have better understanding how this works :)

Best regards,

Peter
Reply all
Reply to author
Forward
0 new messages