This is a brief guide on how you can use Postman with Google Cloud Platform APIs, by connecting your Postman to Google using OAuth 2.0.
Login to Google Cloud Console
In API & Services > Credentials > Create OAuth client ID
Add this under Authorized redirect URIs in your Google Console settings (https://console.cloud.google.com/apis/credentials/oauthclient).
Set your Postman with one of the following callback URI/ redirect URI to:
Please take note of the callback URI/s that you have set, as we want to later make sure it matches what we have set in Postman.
Create a new "Authorization" in Postman.
Fill in your Authorization details and click "Get New Access Token" when you are ready.
When you click on "Get New Access Token" you will be asked to authorize Postman to interface with Google's APIs.
So it will pop up a popup window and you will be asked to log into your Google account. Log in with your Google account used to access your Google Cloud Platform.
This process will generate a OAuth ID and Google will check that the request came from an authorized redirect URL (which we have set).
You will receive an "Authentication complete" message when it is successful. Click Proceed afterwards.
Select "Use Token" to start using your new Access Token.
This will add the Access Token under "Current Token> Access token> Available Tokens" to your Postman environment.
You're all set. You can now run your Google Cloud Platform API calls.
Have fun using it now!
Here is an example, using a Google Cloud Platform API call:
Google Cloud API Method: instances.list
GET https://compute.googleapis.com/compute/v1/projects/{project}/zones/{zone}/instances
where
Login to Google Cloud Console
In API & Services -> Credentials create an OAuth 2.0 client ID
Add one of the following redirect URI/ callback URI under "Authorized redirect URIs" in your Google Console settings (https://console.cloud.google.com/apis/credentials/oauthclient).
That is: redirect_uri:It will be used to populate this Google Cloud API Method: instances.list behind the scenes in your web browser.
Google Cloud API Method: instances.list
GET https://compute.googleapis.com/compute/v1/projects/{project}/zones/{zone}/instances
You should get a Status Code: 200 if it is successful.