Refresh token

163 views
Skip to first unread message

Giosuè Anastasi

unread,
Jun 18, 2023, 6:40:08 AM6/18/23
to Google Ads API and AdWords API Forum
I'm trying to follow this video https://www.youtube.com/watch?v=M5DxbxEwV9s&list=PLKByxjzUC-N_DIBLsb-h_XaaqmYD1vnQM&t=175s
to try the ruby code example.
I have this account manager 584-026-8307 with developer key and a I create a test account as asked in the video that is this one 139-901-9468 

jops@uno:~/Projects/google-ads-test$ ./google-ads-doctor/oauthdoctor/bin/linux/amd64/oauthdoctor -verbose -language ruby -oauthtype installed_app -configpath ./google_ads_config.rb
2023/06/18 12:37:16 Client library language: ruby
2023/06/18 12:37:16 Google Ads API client library config file: google_ads_config.rb
2023/06/18 12:37:16 Config keys and values:
2023/06/18 12:37:16 ClientID = ******************* (hidden)
2023/06/18 12:37:16 ClientSecret = ******************* (hidden)
2023/06/18 12:37:16 DevToken = ******************* (hidden)
2023/06/18 12:37:16 RefreshToken = <empty>
2023/06/18 12:37:16 LoginCustomerID = <empty>
2023/06/18 12:37:16 PrivateKeyPath = <empty>
2023/06/18 12:37:16 DelegatedAccount = <empty>
2023/06/18 12:37:16 Config file validation failed: RefreshToken is empty.

2023/06/18 12:37:16 Please enter a Google Ads account ID:
1399019468
2023/06/18 12:37:22 Making a HTTP Request to Google Ads API:
GET /v8/customers/1399019468 HTTP/1.1
Host: googleads.googleapis.com
User-Agent: google-ads-doctor/source
Developer-Token: REDACTED
Accept-Encoding: gzip


2023/06/18 12:37:22 Get "https://googleads.googleapis.com/v8/customers/1399019468": oauth2: token expired and refresh token is not set
2023/06/18 12:37:22 ERROR: Your refresh token may be invalid.
2023/06/18 12:37:22 Attempting to regenerate refresh token...
2023/06/18 12:37:22 Visit the URL for the auth dialog:
https://accounts.google.com/o/oauth2/auth?access_type=offline&client_id=4822924754-16i8msmqanls8t85ic1020pn3mdvi9dr.apps.googleusercontent.com&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&response_type=code&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fadwords&state=state
2023/06/18 12:37:22 Copy the code here to continue:
Enter Code >> here i enter the code
2023/06/18 12:38:44 Making a HTTP Request to Google Ads API:
GET /v8/customers/1399019468 HTTP/1.1
Host: googleads.googleapis.com
User-Agent: google-ads-doctor/source
Developer-Token: REDACTED
Accept-Encoding: gzip


2023/06/18 12:38:44 A HTTP Status (404 Not Found) is returned while calling https://googleads.googleapis.com/v8/customers/1399019468
2023/06/18 12:38:44 ERROR: OAuth test failed.


I don't understand what I have done wrong. Someone can help me?

Emanuele Lucchese

unread,
Jun 19, 2023, 5:10:12 AM6/19/23
to Google Ads API and AdWords API Forum
We have the same problem. 

I using the php library client. 

Κωστας Μαυρογαλος

unread,
Jun 19, 2023, 8:03:59 AM6/19/23
to Google Ads API and AdWords API Forum
If your project is in "Testing" because you haven't verified it, the refresh token expires after a week of its making.
What helped me(using the PHP client library, was to literally just re-make a refresh token the same you made your first one.
For the PHP library in particular, the file you're looking for is: GenerateUserCredentials.php and it's in the path: "root_folder/examples/Authentication".
Hope this helps

Giosuè Anastasi

unread,
Jun 20, 2023, 11:54:55 AM6/20/23
to Google Ads API and AdWords API Forum
My problem is that I can't even do a single "refresh token". I'm using the official tool https://github.com/googleads/google-ads-doctor/issues 

Pete Lavetsky (AdWords API Guru)

unread,
Jun 20, 2023, 1:04:35 PM6/20/23
to Google Ads API and AdWords API Forum
Google Ads API is on v14 now ... you're referencing v8 which is no longer supported

https://developers.google.com/google-ads/api/docs/release-notes

Pete

Google Ads API Forum Advisor

unread,
Jun 20, 2023, 1:06:43 PM6/20/23
to giosue....@gmail.com, adwor...@googlegroups.com

Hello Giosuè,

Welcome to Google Ads API Support team. Thank you for reaching out to us.

It appears that you are utilizing the usage of OAuth Doctor. Moving forward, we no longer recommend this tool for troubleshooting purposes. Instead, kindly follow our OAuth Guide and other references below:

Reference links:

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

Thanks,
 
Google Logo Google Ads API Team


Google Ads API Forum Advisor

unread,
Jun 21, 2023, 4:54:13 AM6/21/23
to kostasma...@gmail.com, adwor...@googlegroups.com
Hello,

Thank you for sharing your knowledge to the community.

Hi everyone,

Please do let us know if you encounter any issue further, so we could further assist you.
 
This message is in relation to case "ref:_00D1U1174p._5004Q2mVCnJ:ref"


Thanks,
 
Google Logo Google Ads API Team


Google Ads API Forum Advisor

unread,
Jun 22, 2023, 7:53:18 AM6/22/23
to pete.l...@gmail.com, adwor...@googlegroups.com
Hi all,

Thank you Pete for providing that insight.

Yes you are still using Google Ads API v8, and it was already sunset last year. You may check this blog post regarding the sunset of v7 and v8. With this, I suggest to use the latest version of the Google Ads API which is v14. Since you are using the PHP client library, I suggest that you follow the steps here in this link https://developers.google.com/google-ads/api/docs/client-libs/php?hl=en.
If you have other questions feel free to reply on this thread. 
 
This message is in relation to case "ref:_00D1U1174p._5004Q2mVeLF:ref"


Thanks,
 
Google Logo Google Ads API Team


Reply all
Reply to author
Forward
0 new messages