👉 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.
Step 3: Create OAuth credentials and set up the OAuth Consent screen
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
- https://www.googleapis.com/auth/gmail.readonly
- https://www.googleapis.com/auth/gmail.send
- https://www.googleapis.com/auth/calendar
- https://www.googleapis.com/auth/calendar.events
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.
-
Get Object Ids - List Calendars GET https://www.googleapis.com/calendar/v3/users/me/calendarList
-
OAuth Flow - 1. Auth Request POST https://accounts.google.com/o/oauth2/v2/auth
-
Google API Use Cases-Sync Gmail Vacation and Google Calendar - 1. Get GMail Vacation Settings GET {{baseUrl}}/gmail/v1/users/:userId/settings/vacation
-
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}}
-
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}}
-
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}}
-
Google API Use Cases-Record Sheets - 1. Get Gmail Inbox GET {{baseUrl}}/gmail/v1/users/:userId/messages?maxResults={{maxResults}}&pageToken={{pageToken}}&q={{q}}
-
Google API Use Cases-Record Sheets - 2. Get GMail Email Details GET {{baseUrl}}/gmail/v1/users/:userId/messages/:id
-
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}}"aUser={{quotaUser}}&upload_protocol={{uploadProtocol}}&uploadType={{uploadType}}&$.xgafv={{.Xgafv}}
-
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}}"aUser={{quotaUser}}&upload_protocol={{uploadProtocol}}&uploadType={{uploadType}}&$.xgafv={{.Xgafv}}