Skip to main content

2 posts tagged with "Skills"

View All Tags

Integrating Google Calendar with your Serenity* AI Agent

· 3 min read

This guide walks you through integrating Google Calendar with your AIHub agent using OAuth 2.0 authentication. You'll learn how to set up an HTTP Request skill that can create calendar events by making authenticated API calls to the Google Calendar API.

You can use this integration to interact with your Google Calendar in any way you like, such as creating and deleting events, retrieving event details, or updating existing events, all by asking your AI agent to perform these tasks.

Add an HTTP Request Skill

  1. From the agent designer, add a new HTTP Request skill. In the following example, I'm preparing a skill to add new events to my calendar.

    HTTP Request Skill Form

    Configure the following settings:

    • Code: CreateCalendarEvent
    • Description: POST HTTP request that adds an event to the calendar by specifying start date, end date, summary, and description in the body.
    • Method: POST
    • URL: https://www.googleapis.com/calendar/v3/calendars/<google-email-here>/events
  2. Select OAuth2 as your authentication type and press "Create new"

    OAuth2 Authentication Selection

Configuring the OAuth 2.0 Connection

Complete the OAuth 2.0 Connection Configuration form:

OAuth2 Connection Configuration Form

Configure the following settings:

  • Name: Google Calendar (this is just to identify the connection)
  • Auth URL: https://accounts.google.com/o/oauth2/v2/auth
  • Token URL: https://oauth2.googleapis.com/token
  • Client ID: Your Google OAuth app client ID (generated via Google Cloud Console)
  • Client Secret: Your Google OAuth app client secret
  • Scopes: https://www.googleapis.com/auth/calendar

For Google OAuth, you also need to add two additional Auth Request Parameters:

Access Type Parameter:

  • Key: access_type
  • Value: offline

Prompt Parameter:

  • Key: prompt
  • Value: consent

Important: Make sure to add the Redirect URI to your Google OAuth app as specified at the top of the form:

OAuth2 Redirect URI Configuration

Once the OAuth connection is complete, click "Continue" and go through Google's login and consent screens. You should see this success message:

OAuth2 Connection Success Message

Close the tab and return to the OAuth 2.0 Connection form. You should see the new connection configured in the OAuth 2.0 selector:

OAuth2 Connection Selector

Finish Configuring the HTTP Request

Press "Continue" to set up the rest of the request information. In this step, you may need to configure the request body. For my "Create Event" request, I used an AI-generated body like this:

HTTP Request Body Configuration

What's Next?

You can now try your Agent from the Preview panel. Ask it to create a calendar event, and it should respond with a confirmation message.

Once you're sure that's working correctly, you can reuse this OAuth 2.0 connection in other HTTP Request skills to provide your Agent with other ways to interact with your Google Calendar, such as retrieving events or deleting them.

Keep in Mind

  • Permissions: Ensure your Google OAuth app has the necessary permissions to access the Calendar API. You can manage these in the Google Cloud Console.
  • Your Agent will act on your behalf: When you set up the OAuth connection, your agent will be able to create, modify, and delete events in your Google Calendar. Keep this in mind before sharing your agent publicly.

Additional Resources

How to Integrate Your AI Agent with Calendly

· 3 min read
Máximo Flugelman
Máximo Flugelman
Project Manager

When we talk about AI Agents, a key feature to automate your processes and workflows is the capability of integrating with external services. One of these services can be Calendly, for accessing your agenda and organizing your day.

In this article, we will explore how to integrate your AI Agent with the Calendly API using the HTTP Request Skill in Serenity* AI Hub.

About the Example

We will be creating an Assistant Agent that integrates with Calendly to retrieve your daily scheduled events. We will use Calendly’s /scheduled_events endpoint to get a list of upcoming events for the logged-in user.

Prerequisites

  • You should have a Calendly account to follow this step-by-step guide.
  • Inside Calendly, create a Bearer Token that we will use for authentication with the Calendly API.

Setting Up the Agent

For this example, we will be using an existing Agent template in AI Hub called Calendly Assistant. Go to the agent creator screen and select the template from the list.

alt text

Skills Tab

In the skills tab we can see two existing skills that will be used for the integration with Calendly:

  • The first skill will allow you to get the list of upcoming events
  • The second skill allows you to retrieve your Calendy user id

Click on edit the first skill so we can configure your authentication settings.

alt text

Let's go through the configuration settings needed for the Calendly request skill:

alt text

  • Code: A simple identifier for the skill.
  • What is this HTTP Request for? This defines the objective of this skill. If the agent determines that the specified condition is met, it will execute the skill.
  • Endpoint: Specifies the method type and base URL. In this case, we use the scheduled_events?user endpoint, which requires a user parameter. By using the {{userId}} syntax, we indicate that this parameter value will be automatically replaced by the AI. Additional parameters can also be specified using this syntax.
  • URL Parameters: Defines how the agent should replace each URL parameter. In this case, we use Calendly’s user identification system via the User Id.
  • Authentication: Replace the placeholder with your Calendly bearer token.

If you edit the second skill, the one that allows you to retrieve the user by, you should see the following configuration:

alt text

Replace the placeholder with your Calendly bearer token

Testing the Agent

Once the skills are configured, simply type your question to test the agent. For example, you can ask "What are my scheduled events for today?" Your agent should respond with a message like this:

alt text

alt text

Final Tips

  • Check out the Calendly API Reference to further customize and add additional endpoints.
  • You can add dynamic parameters to your base URL, which will be completed by the agent based on the context of the conversation.
  • Clearly define the responsibility of each skill and when it should be executed. This will improve your agent’s performance by avoiding unnecessary skill execution.
  • Integrate your agent with your website, application, or any other service.