To make a Google API call, need to set up the below
- need a developer token
- client need to create app. For example, if use Google ads api, Google ads account customer needs to create app
- get client id and client secret of that app
- that app needs to grant permission to use Google specific api. After grant, should get a refresh access token
- with developer token, client id, client secret and refresh access code, we can make a Google API call (see the below)
How app to grant permission to use Google api. Use Google ads api as example
Option 1: Use Google oauth play ground
- add https://developers.google.com/oauthplayground under Authorized redirect URIs of that App
- go to https://developers.google.com/oauthplayground/
- click setting and click use your own OAuth credentials. Provide app client id and client secret
- select a Google api and click grant permission
- Then can convert verification code to access code and refresh access code
Option 2: build a webpag (for web app) to ask user to grant permission
No comments:
Post a Comment