Postman: "invalid_client, Description: Unauthorized" Error when generating access token for Google Ads API
I created new credentials in Google Developer Console for Google Ads base URL : https://googleads.googleapis.com/v14/customers. and added the scope: https://www.googleapis.com/auth/adwords . Using Oauth2 user consent. https://developers.google.com/identity/protocols/oauth2
In Postman, I performed the following steps in my Google Ads workspace :
1a. Added Client Id and Client Secret to the variables portion of the Google Ads collection.
- Set the token name
- Set the grant type = 'Authorization Code'
- Callback URL = https://oauth.pstmn.io/v1/browser-callback
- Auth URL = https://accounts.google.com/o/oauth2/v2/auth
- Access Token URL = https://oauth2.googleapis.com/token
- Scope = https://www.googleapis.com/auth/adwords
- Refresh token (default) = https://oauth2.googleapis.com/token
When I click the Access New Token button, I get the redirect page requesting me to choose an account. So I choose my google account and allow oauth.pstmn.io to access my google account (This is postman browser) .
The token generation fails with the message below (note that I have already successfully done token generation in Postman with credentials used for DFA Reporting for Campaigns, Sites, and Ads in GCM 360):
However, the result is that I get an "invalid client". How could that be since I created the client in Google Developer Console and copied those over to Postman doing everything that I did successfully for GCM 360 APIs ? Thanks. Here are the slides:
Two really fundamental things that I had forgotten when calling Google Ads whether in Postman OR in an AWS python integration (I cannot believe I missed this !) and they are:
Make sure that the client gives you a developer token Make sure that your scope is non-Sensitive or, if the scope is sensitive, has been approved by Google Developer Team to allow the API to access data.You need both of these to make this work. I was so swayed by the results of the dfareporting scope working for Campaign Manager 360 that I completely forgot the importance of scope sensitivity. Now I'll have to tell the client they must wait anywhere from 3 - 5 days for approval.