5.2K members online now
5.2K members online now
For developers who are using the Google My Business API to manage locations
Guide Me

Access Tokenis getting expired in every one hour

[ Edited ]
Follower ✭ ☆ ☆
# 1
Follower ✭ ☆ ☆

Dear Google Team,

 is there any way to get long lived access token? Currently my access token is getting expired in every hour and I have to get new access token.


Please let me know a way to get long lived access token  


1 Expert replyverified_user

Re: Access Tokenis getting expired in every one hour

Google Employee
# 2
Google Employee

Hi @mKonnekt D,


When using the OAuth 2.0 client ID for authorization, you should store the refresh token for future use and use the access token to access the API. Once the access token expires, the application should use the refresh token to obtain a new one. This way, your application will always be able to request a new access token when necessary.



Shalini, The Google My Business API team

Access Tokenis getting expired in every one hour

Follower ✭ ☆ ☆
# 3
Follower ✭ ☆ ☆

I am facing below issue while creating local post. I am using my business V4 API. I already have access token and Refresh token with scope 
 Also I have tried with newly generated access token from https://developers.google.com/oauthplayground with the same scope. Is there any other access scope I require to have for this?
com.google.api.client.auth.oauth2.TokenResponseException: 401 Unauthorized
at com.google.api.client.auth.oauth2.TokenResponseException.from(TokenResponseException.java:105)
at com.google.api.client.auth.oauth2.TokenRequest.executeUnparsed(TokenRequest.java:287)
at com.google.api.client.auth.oauth2.TokenRequest.execute(TokenRequest.java:307)
at com.google.api.client.auth.oauth2.Credential.executeRefreshToken(Credential.java:570)
at com.google.api.client.googleapis.auth.oauth2.GoogleCredential.executeRefreshToken(GoogleCredential.java:362)
at com.google.api.client.auth.oauth2.Credential.refreshToken(Credential.java:489)
at com.google.api.client.auth.oauth2.Credential.intercept(Credential.java:217)
at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:868)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:419)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:352)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:469)

Experts in the Topic
Shalini S