Google ads API - Python package

48 views
Skip to first unread message

Pierre Bonnet

unread,
Aug 10, 2023, 10:26:12 AM8/10/23
to Google Ads API and AdWords API Forum
I'm trying to use google ads' api through the python package. I have the client id, client secret, refresh token, etc... but I keep getting the error :

google.auth.exceptions.RefreshError: ('unauthorized_client: Unauthorized', {'error': 'unauthorized_client', 'error_description': 'Unauthorized'})

I'm using a test manager account.
I do have my keys between ' in the yaml file. 
I tried deleting one character from the refresh token to see what error would come back and it does return an invalid_grant so it means that the call does go through.
I'm trying to run the create_customer.py script which should be one of the most basic one from my understanding.

What do I need to setup on my google account to finally go forward ?

Thank you for your help,

Google Ads API Forum Advisor

unread,
Aug 10, 2023, 1:46:02 PM8/10/23
to bonn...@gmail.com, adwor...@googlegroups.com

Hi there,

Thanks for reaching out to the Google Ads API Forum.

I can see that the error you have encountered is an unauthorized_client error. Could you confirm if you generated refresh token by following this guide for the Python client library? It would be good to check this configuration, in order to narrow down the issue. 

Once you have followed above, you may retry your request and see if it works without any error. If still an issue, then you may privately send us complete logs in the format of the request and response logs along with request-id as seen in their respective links. To capture these full logs, you may ensure you have followed this logging guide implemented on your end.  

This message is in relation to case "ref:_00D1U1174p._5004Q2nqczH:ref"

Thanks,
 
Google Logo Google Ads API Team


Reply all
Reply to author
Forward
0 new messages