Google Ads API Auth

89 views
Skip to first unread message

Veer

unread,
Apr 25, 2025, 3:20:50 AM4/25/25
to Google Ads API and AdWords API Forum
Hi Everyone, 

I'm trying to get the Google Ads campaigns data using the google ads API, I'm using the service account authentication method but I run into an authentication error saying  "The OAuth client was not found." even when I'm using the correct json secret file from my account. Can you please help me resolve this error.

Thanks & Regards
Veer

Google Ads API Forum Advisor

unread,
Apr 25, 2025, 3:58:13 AM4/25/25
to seap.ma...@gmail.com, adwor...@googlegroups.com
Hi Veer,

Thank you for reaching out to the Google Ads API support team. 

The "OAuth client was not found" error occurs when the OAuth2ClientId/OAuth2ClientSecret specified is not correct. Could you check if it is valid and also that it does not have any extra space?  

In addition, I would suggest to recreate the client id and client secret and generate a refresh token using the new client id and client secret. Since you are using a service account authentication method, I recommend reviewing the service account documentation once more.

To investigate the issue further, could you share updated complete API logs (request and response with request-id and request header) generated at your end?  

If you are using a client library and haven't enabled the logging yet, I would request you to enable logging for the specific client library that you are using. You can refer to the guides Java.NetPHPPythonRuby or Perl to enable logging at your end. For REST interface requests, you can enable logging via the curl command by using the -i flag.

You can send the details via Reply privately to the author option, or direct private reply to this email.

Thanks,
 
Google Logo Google Ads API Team

Feedback
How was our support today?

rating1    rating2    rating3    rating4    rating5
[2025-04-25 07:57:23Z GMT] This message is in relation to case "ref:!00D1U01174p.!500Ht01qUyFH:ref" (ADR-00301810)



Vaibhav Ippili

unread,
Jul 22, 2025, 12:20:03 AM7/22/25
to Google Ads API and AdWords API Forum
I have a related question to this -- 

I am trying to access a google api with a service account but the api requires client_id, client_secret, and a refresh token. However, a service account does not have a client_secret and refresh token. How would I go about this? 

Pls let me know. 

Google Ads API and AdWords API Forum

unread,
Jul 22, 2025, 6:58:39 PM7/22/25
to Google Ads API and AdWords API Forum
Hi,

I would recommend you to refer to this guide for creating the credentials for a service account. Yes, the service account doesn't need the client ID and the refresh token. In order to further investigate your issue as requested earlier, provide the complete API logs (request and response with request-id and request header) generated at your end to further assist you better. 


You can send the details via Reply privately to the author option, or direct private reply to this email.

Regards, 
Google Ads API Team. 

Reply all
Reply to author
Forward
0 new messages