- Availability intelligence
- Dynamic scheduling
- Contextual invitations
- Timezone and conflict management
Prerequisites
- Enable Google Calendar API - Go To https://console.cloud.google.com/apis/enableflow?apiid=calendar-json.googleapis.com
- Select Project and enable the API access (Reference : https://developers.google.com/calendar/api/quickstart/python)
-
(Click for details)
Get the Google OAuth Credentials
-
Enable Google Calendar API
- Go To https://console.cloud.google.com/apis/enableflow?apiid=calendar-json.googleapis.com
- Select Project and Enable The API
- Go To API & Service -> OAuth Consent Screen
-
Select User Type
- If you are Google Workspace User select Internal
- Else Select External
- Fill in the app details (App name, logo, support email, etc.).
-
Select Scope
- Click on Add or Remove Scope
- Search for Google Calendar API (Make sure you’ve enabled Google Calendar API. Otherwise, the scopes will not be visible)
- Select Scopes Accordingly
- From the dropdown check on /auth/calendar scope
- Save and Continue
-
Adding Test User
- Click Add Users and enter the email addresses of the users you want to allow during testing.
- NOTE : Only these users can access the app’s OAuth functionality when the app is in “Testing” mode. If anyone else tries to authenticate, they’ll see an error like: “Error 403: access_denied.”
- To make the app available to all users, you’ll need to move the app’s status to “In Production.”.Before doing so, ensure the app is fully verified by Google if it uses sensitive or restricted scopes.
- Click on Go back to Dashboard
-
Generate OAuth 2.0 Client ID
- Go To Credentials
- Click on Create Credentials -> OAuth Client ID
- Select Application Type as Desktop app
- Download JSON
- Using Google Calendar Tool pass the path of downloaded credentials as credentials_path to Google Calendar tool
-
Enable Google Calendar API
Run the Example
1
Set up your virtual environment
2
Install dependencies
3
Export your OpenAI API key
4
Run the example
Save the code above as
googlecalendar_tools.py, then run: