👉 Google APIs Access and Examples

Number of APIs: 14

Use this collection to get started with Google APIs.

Step 1: Create a Google Cloud Project

Visit the Create a Google Cloud project guide and follow the steps.

Step 2: Enable APIs

To use Google APIs, you need to enable them in the Google Cloud Dashboard.
Follow the Enable the APIs guide to activate your desired APIs in your Google Cloud project. For this collection, you'll need to activate Gmail API, Calendar API, and Sheets API.

Choose your application type and create an OAuth client ID in the Google Cloud Console. Configure OAuth consent through the OAuth consent guide.

Configure your OAuth consent screen and add Test users so you can make calls before entering production.
If you are using a cloud project in your organization, then you'll need to use an email account.

The scopes you'll need are

Step 4: Add Client ID and Client Secret to variables

Step 5: Get an OAuth token

Under the Auth tab in this Qodex Collection, get a token under OAuth2.0 or use the Guided Auth modal when clicking in the request window.

Step 6: Set Parameters for Requests

Set the parameters for your requests, such as subject, sender, recipient, etc.

  1. Get Object Ids - List Calendars GET https://www.googleapis.com/calendar/v3/users/me/calendarList

  2. OAuth Flow - 1. Auth Request POST https://accounts.google.com/o/oauth2/v2/auth

  3. Google API Use Cases-Sync Gmail Vacation and Google Calendar - 1. Get GMail Vacation Settings GET {{baseUrl}}/gmail/v1/users/:userId/settings/vacation

  4. OAuth Flow - 2. Exchange Code for Token GET https://oauth2.googleapis.com/token?client_id={{clientId}}&client_secret={{clientSecret}}&grant_type={{grant_type}}&redirect_uri={{redirectUri}}&code={{code}}

  5. Google API Use Cases-Get Inbox and Send Emails Using Gmail API - 1. List Messages GET {{baseUrl}}/gmail/v1/users/:userId/messages?q=from:{{bossEmail}}

  6. Google API Use Cases-Get Inbox and Send Emails Using Gmail API - 2. Get Messages GET {{baseUrl}}/gmail/v1/users/:userId/messages/:id?format={{format}}

  7. Google API Use Cases-Record Sheets - 1. Get Gmail Inbox GET {{baseUrl}}/gmail/v1/users/:userId/messages?maxResults={{maxResults}}&pageToken={{pageToken}}&q={{q}}

  8. Google API Use Cases-Record Sheets - 2. Get GMail Email Details GET {{baseUrl}}/gmail/v1/users/:userId/messages/:id

  9. Google API Use Cases-Record Sheets - 3a. Get Google Sheet if Exist GET {{baseUrl}}/v4/spreadsheets/:spreadsheetId?ranges={{ranges}}&includeGridData={{includeGridData}}&access_token={{accessToken}}&alt={{alt}}&callback={{callback}}&fields={{fields}}&key={{key}}&oauth_token={{oauthToken}}&prettyPrint={{prettyPrint}}&quotaUser={{quotaUser}}&upload_protocol={{uploadProtocol}}&uploadType={{uploadType}}&$.xgafv={{.Xgafv}}

  10. Google API Use Cases-Record Sheets - 3b. Create Google Sheet if Does Not Exist POST {{baseUrl}}/v4/spreadsheets?access_token={{accessToken}}&alt={{alt}}&callback={{callback}}&fields={{fields}}&key={{key}}&oauth_token={{oauthToken}}&prettyPrint={{prettyPrint}}&quotaUser={{quotaUser}}&upload_protocol={{uploadProtocol}}&uploadType={{uploadType}}&$.xgafv={{.Xgafv}}