Resources »

Guides »

Integrations »

Google »

Cerb + Gmail

Introduction

In this guide we’ll walk through the process of linking Cerb to Gmail. You can use the same process with any Google API from Cerb bots to automate whatever you need.

Configure Google APIs

Create a new project

  1. Log in to: https://console.developers.google.com/cloud-resource-manager/

  2. Click Create Project in the top right.

  3. Enter:

    Project Name: Cerb
    Organization: (none, or your preference)
  4. Click the blue Create button.

  5. Click Select Project in the notification in the top right.

  1. Select OAuth consent screen in the left sidebar.

  2. Enter:

    User Type: Internal (if GSuite), or External
  3. Click the blue Create button.

  4. Enter:

    Application name: Cerb
    Scopes for Google APIs: email, profile, openid
    Authorized domains: (your Cerb base URL; e.g. cerb.example.com)
  5. Click the blue Save button.

Enable Gmail API

  1. Click Library in the left sidebar.

  2. Search for Gmail and select Gmail API.

  3. Click the blue Enable button at the top of the page.

Add credentials

  1. Click Create Credentials in top right.

  2. Enter:

    Which API: Gmail API
    Calling from: Web server
    What data will you be accessing: User data
  3. Click the blue What credentials do I need? button.

  4. Enter:

    Name: Cerb
    Authorized redirect URIs: https://YOUR-CERB-HOST/oauth/callback
  5. Click the blue Create OAuth client ID button.

  6. Click the Download button.

  7. Click the Done button.

Add Gmail scope

  1. Select OAuth consent screen in the left sidebar.

  2. Click Edit App at the top.

  3. Click the Add scope button.

  4. Select: https://mail.google.com/

  5. Click the blue ADD button in the bottom right of the popup.

  6. Click the Save button at the bottom.

Configure Cerb

Create the connected service

  1. Navigate to Search » Connected Services.

  2. Click (+) button in the right of the gray bar above the worklist.

  3. In the Library tab, select the Google package.

  4. Paste your Client ID and Client Secret from the credentials you downloaded earlier.

  5. Scope:

     
     https://mail.google.com/ https://www.googleapis.com/auth/userinfo.profile
     
     
  6. Click the Create button.

Create the connected account

  1. Navigate to Search » Connected Accounts.

  2. Click (+) button in the right of the gray bar above the worklist.

  3. Select Google.

  4. Enter:

    Name: Gmail (you@example.com)
  5. Click the blue Link to Google button.

  6. Log in with your Google account.

  7. Until your app is verified, click Advanced link at the bottom, then click the Go to (your Cerb URL) link.

  8. Click Allow.

  9. Make sure both permissions are selected.

  10. Click the Allow button again.

  11. Click the Save Changes button.

Next steps

See: Authenticate a Gmail mailbox using IMAP and XOAUTH2