- In the Scopes section, we can specify the permissions we want users to authorize for our app.
- After saving the Scopes section, the OAuth consent section will be completed.
- Back in the Credentials section, we can start creating credentials. Click the CREATE CREDENTIALS button to start this process. From the menu, choose OAuth client ID:
Figure 10.15 – The CREATE CREDENTIALS button and the possible choices
- From the drop-down menu, choose Web application:
Figure 10.16 – Selecting an OAuth client ID application type
- Enter the name of the web application and set Authorized redirect URIs to https://oauth.pstmn.io/v1/callback and https://www.getpostman.com/oauth2/callback, respectively:
Figure 10.17 – Authorized redirect URIs to work with Postman
- Click CREATE to finalize the OAuth client ID creation process:
Figure 10.18 – OAuth client created
- You will receive a client ID and client secret in the window. We will use these to authenticate our API request in Postman.
Now that we’ve retrieved the Client ID and Client Secret details, we must familiarize ourselves with API call types and response codes.
Popular API calls
To work with API calls, it is essential to understand which API calls we can make and what they do. Here is a list of the most popular ones:
- GET: A request to retrieve information from the server
- POST: A request to send information to the server
- PUT: A request to update existing data on the server
- DELETE: A request to delete data from the server
- PATCH: A request to update existing data on the server partially
- OPTIONS: A request to retrieve information about the communication options available on the server
- HEAD: A request to retrieve only the header information from the server
- CONNECT: A request to establish a network connection to the server
- TRACE: A request to retrieve a diagnostic trace of the actions performed by the server
- Remote Procedure Call (RPC): A request to execute a procedure on a remote server.
Now that we’ve learned what popular API calls we can make, it is essential to know what the most popular HTTP status codes are in response to API calls:
- 200 OK: The request was successful, and the response contains the requested data.
- 201 Created: The request has been fulfilled, and a new resource has been created.
- 204 No Content: The request was successful, but there is no data to return.
- 400 Bad Request: The request was malformed or invalid.
- 401 Unauthorized: Authentication is required and has failed or has not been provided.
- 403 Forbidden: The server has understood the request but refuses to authorize it.
- 404 Not Found: The requested resource could not be found.
- 500 Internal Server Error: The server encountered an error while processing the request.
- 502 Bad Gateway: The server received an invalid response from the upstream server.
- 503 Service Unavailable: The server cannot handle the request due to a temporary overload or maintenance.
In the next section, we will learn how to use Postman to make simple API calls in Google Cloud.