Access Token not generating through Oauth2 API

37 views
Skip to first unread message

ritesh1...@gmail.com

unread,
Oct 26, 2018, 12:21:46 AM10/26/18
to AdWords API and Google Ads API Forum

we are trying to generate access token using 

 

https://www.googleapis.com/oauth2/v4/token?client_id=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.apps.googleusercontent.com&client_secret=********************&refresh_token=1/0z1VUN_LmxR-wnr67812blTb6F7jHUosQmNe6HsUxtw&grant_type=refresh_token

 

the client id and refresh token is defined in the developer console and using the OAUTH Playground, we are able to generate the access token manually for the required scope. 

 

is there anything we need to do with the API call to generate the token using the same refresh token as in the OAUTH Playground

Peter Oliquino (AdWords API Team)

unread,
Oct 26, 2018, 2:34:10 AM10/26/18
to AdWords API and Google Ads API Forum
Hi,

As long as the refreshToken you specify in your properties file is associated to your clientId and clientSecret (in the same file), then, generating the access tokens via the client library should not be an issue.

Thanks and regards,
Peter
AdWords API Team

ritesh1...@gmail.com

unread,
Oct 26, 2018, 7:11:10 AM10/26/18
to AdWords API and Google Ads API Forum
Hi Peter,

thanks for the quick response. looks like when we are generating the access key from the playground it is referring to a different client id than what is defined in the developer console also the response gives a different refresh token. is there anything we need to do to authorize the client in  the developer console. do we need to publish the OAuth Consent on the OAuth Consent screen 

Peter Oliquino (AdWords API Team)

unread,
Oct 29, 2018, 12:15:37 AM10/29/18
to AdWords API and Google Ads API Forum
Hi,

My apologies as your developer console concern is already out of scope for us. However, I would recommend that you access the said page while in a session and logged in as the user (email address) in which you originally created your own OAuth2 crendentials with. You may carefully follow the steps mentioned in this guide.

Best regards,
Peter
AdWords API Team
Reply all
Reply to author
Forward
0 new messages