0
votes

I need to refresh my GA token using json format, but I can NOT get it to work. It works great using parameters. Please let me know if you see any flaws! THANKS!!!!

Works (no json) ======================================== curl -d "client_id={myId}&client_secret={mySecretId}&grant_type=refresh_token&refresh_token={myRefreshToken}" https://accounts.google.com/o/oauth2/token

Doesn't work (json) ===================================== curl -H "Accept: application/json" -H "Content-type: application/json" -d '{ "client_id" : "{myId}", "client_secret" : "{mySecretId}", "grant_type" : "refresh_token", "refresh_token" : "{myRefreshToken}" }' https://accounts.google.com/o/oauth2/token

1

1 Answers

1
votes

See https://developers.google.com/accounts/docs/OAuth2WebServer#refresh - this particular flow only works with application/x-www-form-urlencoded