Bijan
Bijan

Reputation: 8610

Google API: Get Refresh/Access Token on each run

I am making a HTTP GET Request to the googleapi page to return information regarding my adsense account. When I do this, I send a header of Authorization: Bearer ACCESSTOKEN but the Access Token is only valid for 1 hour. How would I get a new Access Token the next time I run my script without using the browser?

Upvotes: 0

Views: 50

Answers (1)

hasbi
hasbi

Reputation: 520

When you are saving access token, save refresh token too (in authorization code exchange)

then, use refresh token to get new access token after 1 hour

Upvotes: 1

Related Questions