Step 1: Create a Google Cloud Project and Enable the Google Calendar API

  •  Go to the Google Cloud Console.
  •  Click the project drop-down and select or create the new project for which you want to enable the Google Calendar API.
  •  In the Cloud Console, navigate to the “APIs & Services” -> “Library” section.
  •  Search for “Google Calendar API” and click on it.
  •  Click the “Enable” button to enable the Google Calendar API for your project.

Step 2: Create OAuth 2.0 Credentials

  • In the Cloud Console, navigate to the “APIs & Services” > “Credentials” section.
  • Click the “Create Credentials” button and select “OAuth client ID
  • Select “Web application” as the application type.
  • In the “Authorized JavaScript origins” field, enter the URL of your Postman instance (“https://app.getpostman.com” if you are using Postman for the web).
  • In the “Authorized redirect URIs” field, enter the callback URL for Postman. For Postman’s web version, use “https://www.getpostman.com/oauth2/callback” If you use the Postman desktop application, use the appropriate callback URL.
  • Click the “Create” button to create the OAuth client ID.

Note: down the “Client ID” and “Client Secret” that is generated. You’ll need these for authentication.

Step 3: Set Up Postman for Google Calendar API

Open Postman and create a new request in Postman.

Step 4: Configure OAuth 2.0 Authorization in Postman

In your Postman request, go to the “Authorization” tab. Select “OAuth 2.0” from the “Type” dropdown. In the “Grant Type” dropdown, select “Authorization Code

Fill in the following information:

1. Token Name: Google Calendar API

2. Callback URL: Use the callback URL you specified when creating OAuth credentials. (“https://www.getpostman.com/oauth2/callback“)

3. Auth URL: “https://accounts.google.com/o/oauth2/auth”

4. Access Token URL: “https://accounts.google.com/o/oauth2/token

5. Client ID: Use the Client ID from your Google Cloud project.

6. Client Secret: Use the Client Secret from your Google Cloud project.

7. Scope: Enter the necessary scopes for the Google Calendar API, such as “https://www.googleapis.com/auth/calendar.readonly” for read-only access.

Click the “Get New Access Token” button.

Follow the prompts to log in to your Google account and grant permission to Postman to access your Google Calendar data. Once you have granted access, Postman will receive an access token.

Step 5: Make API Requests

GET Request for Google Calendar

Endpoint: “https://www.googleapis.com/calendar/v3/calendars/primary/events

Description: fetch data for Google Calendar.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.