I've been using 2 REST API calls to batch upload google offline click conversions. One generates the Access Token. The other is the API call to upload the offline click conversions.
All was well for a few weeks until suddenly we started getting invalid_grant
messages in the JSON when trying to generate the Access Token. No clue why -- and we received no email or anything from Google on this. It just stopped working and the invalid_grant error was cryptic and the online help didn't explain much.
I resolved this issue by following this video to generate a new Refresh Token in the Google oAuth Playground:
https://youtu.be/KFICa7Ngzng
So, my question is -- can we automate this somehow? I can trap the invalid_grant JSON response and then would like to do some series of REST API calls to generate a new Refresh Token. Or, would I need to switch from a Web Application Type to a Service Account Type on the oAuth?
I also researched what might have caused the Refresh Token to expire. I looked at the following page and none of those bullet items applied to my situation:
https://developers.google.com/identity/protocols/oauth2#expiration