Google Calendar

The Google Calendar Integration for Botpress enables your bot to access and create Google Calendar data in real-time, automating workflows like CRM updates, inventory management, and survey tracking directly within chat.

Google Console

  • First, you need to access: https://console.developers.google.com/
  • Log in with your Google account
  • Next to the Google logo, click on the dropdown list
  • After clicking on the dropdown list in the image, a modal will open and you should click on New Project In this image, the name is listed as Botpress Google Sheet because it is an integration that was already set up previously.
    In this image, the name is listed as Botpress Google Sheet because it is an integration that was already set up previously.
  • You will need to enter your project information such as:
    • Project name
    • Organization
    • Location
      In this case, the name of my project is Tutorial Botpress Integration, but feel free to choose your own name.
      In this case, the name of my project is Tutorial Botpress Integration, but feel free to choose your own name.
  • Then click on the create button
  • To make sure you are in the correct project, check the project name next to the Google logo Screenshot 2024-10-08 at 1.04.26 PM.png
  • The next step is to click on Menu → API & Services → Credentials
    Screenshot 2024-10-08 at 1.05.45 PM.png
  • Click on Create Credentials → API Key to create an API key Screenshot 2024-10-08 at 1.08.55 PM.png
  • The next step is to click on library and in the screen that opens, search for Calendar and enable the Google Calendar API
    Screenshot 2024-10-08 at 1.28.57 PM.png Screenshot 2024-11-18 at 1.35.03 PM.png
  • The next step is to create a Service Account
  • Still in the Menu → API & Services → Credentials Screenshot 2024-10-08 at 1.51.23 PM.png
  • Fill in the information. When the service account name is filled, the Service Account ID will be automatically generated
    image.png
  • The other fields are optional and do not need to be filled in, so after defining the Service Account Name, just click on Done
  • After the Service is created, you should go to the KEYS tab image.png
  • A modal will open where you will select JSON → Create Screenshot 2024-11-18 at 1.49.33 PM.png
  • A JSON file will be downloaded to your machine and we will use this information in our integration with the Botpress bot
  • Your JSON should look like this (in this case, I've omitted the values as they are sensitive information):
    {
      "type": "",
      "project_id": "",
      "private_key_id": "",
      "private_key": "",
      "client_email": "",
      "client_id": "",
      "auth_uri": "",
      "token_uri": "",
      "auth_provider_x509_cert_url": "",
      "client_x509_cert_url": "",
      "universe_domain": ""
    }
    

Creating OAuth client ID

  • After generating the JSON file, you'll need to create the OAuth Client ID authentication image.png
  • You'll need to select an Application Type and also create a name, then click on CREATE
    image.png

Creating OAuth Consent Screen

  • After creating the OAuth, you'll need to create the OAuth consent screen
  • Create an App name and for User support email, just select your email
    image.png
  • Further down, you'll need to create the App domain, where you'll need to enter the URL of your calendar for both the Application home page and Application privacy policy link. But if you have another URL for this information, you can use it
    image.png
  • In Authorized domain, you'll need to add at least google.com as shown in the image below
  • Also add a contact email, in this case, the developer's email can be any email
  • After entering this information, click on SAVE AND CONTINUE image.png

Scopes

  • You should add some scopes by clicking on the button as shown in the image below image.png
  • Below I will provide the list of all scopes that should be added for the integration to work correctly
    Screenshot 2024-11-18 at 3.35.12 PM.png
    Screenshot 2024-11-18 at 3.35.55 PM.png
  • Then you'll need to provide some justifications for why you're using the scopes. Just explain that the bot needs the scopes to create, delete, update, and read
  • You'll also need to provide a YouTube demo link. You can use whichever one you find necessary image.png

Google Calendar Authorizations

  • In your Google Calendar dashboard
  • You'll need to go to your calendar settings
  • To do this, just click on the gear icon in the upper corner as shown in the image below image.png
  • The next step is to click on your calendar
    image.png
  • After selecting the calendar, you should add the email that the bot uses in its integration
    image.png
  • To know the email that the bot uses, you should consult the JSON file you downloaded
    • Open the downloaded JSON file, you can use any text editor for this
    • Copy the client_email
    • Paste the email to be added
  • After adding the email, you should change its permission so that it can make changes to events
Screenshot 2024-11-18 at 4.33.35 PM.png

Bot Integration Settings

  • In your Botpress Studio, in the upper corner, you should install the integration
    image.png
  • Search for the Google Calendar integration verified by Botpress and install it
    image.png
  • After installation, you should change the configuration to configure manually image.png
  • You'll need to enter the necessary information to perform the integration
    image.png
  • To get the Calendar ID information, you should go to settings as you did before
  • Select your calendar → Integrate calendar, you will find your Calendar ID as shown in the image below image.png
  • For the other integration information, you can find everything in the JSON file you downloaded and should use the client_email and private_key
  • After that, click on Save Configuration
  • After these steps, you can use Google Calendar in your bot.