Obtaining an API key for the Gmail API

Obtaining an API key for the Gmail API

Oct 28, 2019

This tutorial demonstrates how to create a project in the Google API console and enable the Gmail API. This tutorial covers both creating your application as well as retrieving your OAuth 2.0 client ID and client secret.

Steps to follow:

  1. Sign in to the Google Cloud console - https://console.developers.google.com/
  2. Select your Google's project (or create a new one)
  3. Search for the Gmail API and enable it
  4. On the main menu, select "APIs & Services" then "Credentials"
  5. Now create credentials with the "OAuth client ID" method
  6. If you don't have one, you'll have to configure an OAuth consent screen. Inside the OAuth consent screen configuration, make sure that "bearer.sh" is listed in the "Authorized domains"
  7. Now, back to create an OAuth client ID page, select "Web application"
  8. In the Authorized redirect URIs, paste the following URL - https://int.bearer.sh/v2/auth/callback
  9. Click on "Create" and that's it!