- Create OAuth client ID from Google Credentials
- Request OAuth on browser
I use business.manage
as scope here, change to yours
https://accounts.google.com/o/oauth2/auth?client_id=<CLIENT_ID>&redirect_uri=http://localhost&scope=https://www.googleapis.com/auth/business.manage&access_type=offline&response_type=code
If success, you will get a code from the url.
- Request Access token
curl \
-d client_id=<CLIENT_ID> \
-d client_secret=<CLIENT_SECRET> \
-d redirect_uri=http://localhost \
-d grant_type=authorization_code \
-d code=<CODE> \
https://accounts.google.com/o/oauth2/token