I have created a test account in https://console.cloud.google.com/

I followed the instructions in the following link: OAuth Web Application Flow

All went ok till Step 3 - Generating a refresh token. In Step 3: sub steps 1-4 went ok as describe in the link.

But on sub step 5 I am getting :

The authentication flow has completed. You may close this window.

and in my cmd I see:

Access token: XXXXXXXXXX Refresh token: None

Can someone please help me to understand what am I doing wrong?

Thanks,

Nir

I've set up the whole Google Ads API according to this manual here: https://developers.google.com/google-ads/api/docs/client-libs/python/oauth-desktop?hl=en

I got my refresh token and put it in my google-ads.yaml file which looks exactly like this: https://github.com/googleads/google-ads-python/blob/master/google-ads.yaml. I also put my client_id, developer_token and client_secret at the corresponding spots in the file.

Everything worked out and I could for example ask for all campaigns: https://developers.google.com/google-ads/api/docs/samples/get-campaigns#python. Also I could use other services of the API.

Each time I use the API I access it via the client using the following code:

from google.ads.google_ads.client import GoogleAdsClient client = GoogleAdsClient.load_from_storage(path_to_google_ads_yaml_file) 

As I already said it worked.

A few days later I tried to connect again and I got the following error:

 “error”: “invalid_grant”, “error_description”: “Token has been expired or revoked.” 

So I did the process of getting a new refresh token again (https://developers.google.com/google-ads/api/docs/client-libs/python/oauth-desktop?hl=en) such that everything worked out again.

One day later I got the same error again. So my question is: What is the purpose of the refresh token? I thought it allows me to access the API without ever having to ask for a new token or refresh token!?

Now, I again tried to connect to the API once more (although it didn't work last time) and now I got an even worse and new error:

'invalid_grant: Bad Request', '{\n  "error": "invalid_grant",\n  "error_description": "Bad Request"\n}' 

So things are getting even more complicated...

I’m trying to forecast the value of various keywords using the google Adwords API, using the traffic estimator service. So far, the clicks, costs per click, and other metrics returned through the API don’t come anywhere close to those retrieved through the Keyword Planner console. There are several adjustable forecast parameters in the console such as language, location, and search network, and I tried to match these parameters in the API.

I'm wondering if there is some other element that needs to be adjusted that I'm missing. For example, the console gives you the option to "select an ad group" for the forecast, and I'm not sure how this would be applied within the API.

I am currently trying to integrate single Google Ads account for my client using RestSharp in C# (don't want to use client libraries). I have found the useful link to generate access token by providing client ID , Client secret and Refresh token.

https://developers.google.com/google-ads/api/docs/rest/auth

I am now trying to test on Postman first before I start developing code in C# but failing to get access token. The screen shot below shows the call I am doing to get access token using Post man.

I also tried CURL in postman which was mentioned in the link above but getting the same error.

FYI it is a Desktop app chosen in google console to generate client ID and secrete because I will be creating console app to integrate Google Ads API.