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. - 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.
- Then click on the create button
- To make sure you are in the correct project, check the project name next to the Google logo
- The next step is to click on Menu → API & Services → Credentials
- Click on Create Credentials → API Key to create an API key
- The next step is to click on library and in the screen that opens, search for Calendar and enable the Google Calendar API
- The next step is to create a Service Account
- Still in the Menu → API & Services → Credentials
- Fill in the information. When the service account name is filled, the Service Account ID will be automatically generated
- 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
- A modal will open where you will select JSON → Create
- 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
- You'll need to select an Application Type and also create a name, then click on CREATE
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
- 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
- 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
Scopes
- You should add some scopes by clicking on the button as shown in the image below
- Below I will provide the list of all scopes that should be added for the integration to work correctly
- 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
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
- The next step is to click on your calendar
- After selecting the calendar, you should add the email that the bot uses in its integration
- 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
Bot Integration Settings
- In your Botpress Studio, in the upper corner, you should install the integration
- Search for the Google Calendar integration verified by Botpress and install it
- After installation, you should change the configuration to configure manually
- You'll need to enter the necessary information to perform the integration
- 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
- 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.
Updated 6 days ago