How to Integrate Your AI Agent with Calendly
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.
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.
Let's go through the configuration settings needed for the Calendly request skill:
- 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:
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:
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.