📆 How to Create a Chatbot That Books Appointments With Pabbly

📚 Learn how to build a chatbot that handles appointment booking with confirmations and reminders using complementary tools like Pabbly and a booking app.

💡 PRO TIP: Click here to hire an expert to guide you in the step by step. Book a call now to learn all the tips and tricks for training your AI, or let us handle it all for you instead.

Creating a chatbot that books appointments is a game-changer for businesses. While the app itself doesn’t have a native booking feature, you can still achieve this functionality by using two complementary tools: Pabbly and a booking app, such as Calendly.

In this tutorial, we’ll guide you through a three-step process:

  1. Setting up the chatbot for booking.
  2. Sending appointment confirmations to users.
  3. Sending timely reminders to keep everything on track.

We’ll also cover how to implement these steps for both accounts with the Official Meta API integration and those using QR API integration, as the processes differ slightly. Let’s get started!

💡 PRO TIP: We recommend using Calendly because it integrates smoothly with Pabbly. However, feel free to use any booking app you prefer. Simply configure an API action in Pabbly to retrieve information from your chosen app. Hire an expert to teach you how.

Creating the Chatbot

To create an appointment-booking chatbot, we will follow the usual process of building a bot. You can choose between using keyword-based items or AI responses, depending on your preference. The essential part is ensuring that your chatbot can deliver a URL where users can book an appointment and see available time slots. This is where a booking app, such as Calendly, becomes indispensable.


Log in to Calendly.
Go to Calendly’s website and sign in with your account.

Create a New Event.
Click on New Event Type on your dashboard. Select an event type and follow the setup wizard. Define details like the event name, duration, and availability.

Add a form asking for the booker’s WhatsApp number. Ensure the booking page includes a form field asking for the booker’s WhatsApp number. This step is crucial because it will make the integration smoother by providing the necessary contact information to send confirmations directly to WhatsApp. To do this, go to the Invitee Questions section while configuring the event. Add a new question, select Phone Number as the type, and label it as “WhatsApp Number” or something similar.
Set this field as required to ensure every user provides their contact number.

💡 PRO TIP: You can ask for additional details from the user in this form, and use them later to further personalize the confirmation and reminder messages.

Save and Copy the Event Link. Once the event is created, Calendly will generate a link for the event’s calendar. You can find this link by clicking on the event and selecting Copy Link from the event details page. This link is what your chatbot will share with users to guide them to book an appointment.

Setting Up the Chatbot


Create a New Item in the Chatbot. 
Log into our chatbot’s platform. Go WhatsApp > Chatbot. Look for the account where you wish to install the bot and create a new item.

Use keywords such as “book an appointment,” “schedule a call,” or “I want to book” as triggers for this item. Configure the rest of the settings as usual.

Add the Appointment Link.  Write a message response that includes the booking link. For example: “Great! You can book an appointment with us by clicking the link below and selecting a time that works for you: yourcalendlylink.com”. Customize this message to make it more personal if needed.

Test the Chatbot. Simulate a user asking to book an appointment to ensure the chatbot responds correctly with the link.

With this setup, your chatbot will be ready to handle appointment-booking requests seamlessly by directing users to your Calendly calendar or any other booking app of your choice.

Sending Appointment Confirmations

Once someone books a meeting in the calendar, it’s essential to send a confirmation message via WhatsApp to ensure they know the appointment details and have instructions to join. This step helps enhance professionalism and reduces the chances of missed meetings.

To achieve this, we’ll use Pabbly Connect (a free tool for basic integrations) to create an automation that sends a WhatsApp message whenever a new booking is made.

💡 PRO TIP: If you’re using Calendly, you’ll need a license that includes API connections. While we’re using Calendly in this tutorial for demonstration purposes, you can replace it with any booking app that allows you to extract information via API REST.

On the following steps of the tutorial, we’ll show you how to:

  • Set up appointment confirmations for Official Meta API accounts.
  • Set up appointment confirmations for QR API accounts.

Each method requires slightly different steps, but the outcome will be the same: your chatbot will send a personalized WhatsApp confirmation to users who schedule an appointment.

For Official Meta API Accounts


Log in to your Pabbly Connect account.
Click on Create Workflow and name it something like Appointment Confirmation.

Set up the Trigger. In the workflow, select Calendly as the app for the first step. For the trigger event, choose Invitee Created (Organization).

Connect Calendly to Pabbly. Click on Connect and authorize Pabbly to access your Calendly account. It will be automatically linked to the workflow. Once connected, make sure the organization and user fields are the ones containing the event you created before.

Test the Trigger. Click Save and Send Test Request. To test this, book an event in the calendar you created earlier. Ensure you use a valid WhatsApp number in the form. Pabbly will capture the data and display a response, mapping details like the booker’s name, appointment time, and WhatsApp number.

Add the Action Step.  After successfully testing the trigger, click on + to add a new action step. Select WhatsApp Cloud API as the app and choose Send Template Message for the action event.

Connect Your WhatsApp Cloud API Account. Click on Connect and a window will pop up asking for three pieces of information: Token, Phone Number ID & WhatsApp Business Account ID. Add them.

💡 PRO TIP: To obtain these details, refer to Pabbly’s documentation: WhatsApp Cloud API Guide. Follow the instructions carefully to set up and get the required credentials.

Once connected, move to the next step to set up your confirmation message.

Create a Confirmation Message Template. To send a confirmation message, you’ll need to create a template in the WhatsApp Manager. Go to the WhatsApp Manager. Select your WhatsApp account and click Manage Templates. Click Create Template and follow these steps:

  • Type: Select Utility.
  • Name: Enter a name for your template (no spaces, e.g., appointment_confirmation).
  • Language: Choose the language for your message.
  • Header: Optionally, add a header, such as “Meeting Confirmation.”
  • Footer: You can also include a footer, like “Thank you for booking with us!”

In the Body section, write the main content of your message and include variables for dynamic data that we will take from Calendly:

  • Variable 1: User’s name
  • Variable 2: Event’s name
  • Variable 3: Date of the meeting
  • Variable 4: Time
  • Variable 5: Location

Here’s an example of what your confirmation message could look like:

Remember that variables are placeholders for dynamic data that will be filled in when the message is sent. For instance:

  • {{1}} will be replaced with the user’s name.
  • {{2}} will be replaced with the event’s name.

Provide Meta with sample data for each variable to show how the template will look in practice.

Submit the template for review. Meta typically approves templates within a few hours.

Use the Template in Pabbly.  Once the template is approved, return to Pabbly Connect and click the refresh button next to the template name box. Select your template from the dropdown menu.

Map Data to the Template. Now, fill the template with the data retrieved from Calendly:

  • Recipient Mobile Number: Select the WhatsApp Number field mapped by Calendly.
  • Body Fields: Map each variable:
    • Field 1: User’s name from Calendly.
    • Field 2: Event’s name.
    • Field 3: Date of the meeting.
    • Field 4: Time of the meeting.
    • Field 5: Location (if applicable).

Test the Setup. Click on Save and Send Test Request.  If successful, you’ll see a response marked accepted. 

The confirmation message will be sent to the specified WhatsApp number.

Formatting the date and time

Once the message is sent, you will see that the answers provided in the Calendly form you used to test the trigger appear in this test message replacing the variables. You will also notice that the date and time look like this: 2024-06-17T19:30:00.000000Z. To fix this, we’ll use Pabbly’s Date/Time Formatter to reformat the data.

Add a New Action Step: Format the Date. In your Pabbly Connect workflow, click + to add another action step between the Calendly Trigger and the WhatsApp Cloud API action. Select Date/Time Formatter (Pabbly) as the app. Choose Format Date with Timezone as the action event and configure the fields as follows:

  • Date Field: Select the Start Event field mapped from Calendly.
  • From Format: Select YYYY-MM-DDTHH:mm:ssZ.
  • To Format: Select MMM DD YYYY.

Verify the response. Click Save and Send Test Request. The raw date format 2024-06-17T19:30:00.000000Z will now appear as 17 Jun 2024.

Add Another Action Step: Format the Time. Add another Date/Time Formatter action. Repeat the same steps as before, but configure the To Format field as HH:mm to extract the time. Click Save and Send Test Request.

Verify the response. The raw time format will now appear as 18:30.


Update the WhatsApp Cloud API Action.
Go back to the WhatsApp Cloud API action step. In the Body Fields mapping:

  • Replace the original mapping for Variable 3 (Date) with the result of the first formatter.
  • Replace the original mapping for Variable 4 (Time) with the result of the second formatter.

Test the Workflow. Click Save and Send Test Request again in the WhatsApp API action step. Verify the sent message:
The date and time will now appear as 17 Jun 2024 and 18:30, respectively, in the confirmation message.

Up to here, your Pabbly workflow must look like this:

For QR API Accounts

For QR API accounts, confirmation messages are sent through your chatbot platform using the Send Direct Message API. However, there’s an additional step to format the phone number correctly before sending the API request. Follow these steps carefully:

Replace the WhatsApp Cloud API Step with an API Request.  After formatting the date and time as mentioned before,  click + to add a new action step. Select the App and Action Event:

  • App: API (Pabbly)
  • Action Event: Execute API Request

Configure the Action Event. As Custom Request Method, select POST.

Add the API Endpoint URL. Follow these steps to extract the endpoint URL:

  • Open your chatbot platform and navigate to: WhatsApp Module > API. Do not select a WhatsApp account.
  • Locate the Send Direct Message API section and copy the Resource URL under POST Send Text.
  • Paste this URL into the API Endpoint URL field in Pabbly.

Set Request Parameters. Back in Pabbly, continue configuring the API request event as indicated:

  • Payload Type: Select JSON.
  • Wrap Request in Array: Select No.
  • Authentication: Select No.

Format the WhatsApp Number. Before proceeding, you need to ensure that the WhatsApp number from Calendly is formatted correctly, as the raw mapping will likely include spaces or the “+” sign, which will cause the API to fail. So, add Another Action Step:

  • App: Number Formatter (Pabbly)
  • Event: Spreadsheet Formulas

Enter the Formula. Use the following formula in the Formula Field, replacing the text whatsapp number with the mapped field for the actual WhatsApp number:

SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(‘whatsapp number‘, ‘ ‘, ”), ‘ ‘, ”), ‘ ‘, ”), ‘+’, ”)

Save & Send Test Request. After running the test, the formatter will return the WhatsApp number in the correct format. Use the formatted number in the following steps to ensure the API request works.

Add Headers. Go back to the Execute API Request step to keep configuring it.  Tick the Add Headers checkbox and fill in the fields:

  • Label: Content-Type
  • Value: application/json

In the Data field, paste the following JSON code, replacing the placeholders with mapped fields from Calendly, the formatter steps, and the formatted WhatsApp number:

{
“number”: “{{formatted_whatsapp_number}}”,
“type”: “text”,
“message”: “Hey,
Your {{calendly_event_name}} is confirmed.
🗓 Date: {{formatted_date}}
⏰ Time: {{formatted_time}}
📍 Location: {{calendly_event_location}}”,
“instance_id”: “[replace]”,
“access_token”: “[replace]”
}

Replace {{formatted_whatsapp_number}}, {{calendly_event_name}}, {{formatted_date}}, {{formatted_time}}, and {{calendly_event_location}} with their corresponding mappings from Calendly and the formatter steps, as shown on the image below.

Retrieve Your Instance ID and Access Token. To complete the JSON, retrieve the instance_id and access_token from your chatbot platform. Open your platform and go to WhatsApp Module > Profile. Select the WhatsApp account you are using. Copy the Instance ID and Access Token displayed there.

Paste them back in the corresponding fields of your JSON code,

Test the API Request. Click Save and Send Test Request in Pabbly. You should see an “Accepted” message. Verify the WhatsApp account to ensure the confirmation message was sent successfully.

If everything is set up correctly, the recipient will receive a message like this:

Up to here, your Pabbly workflow for the QR code API must look like this:

Setting up reminders

In this section, we’ll configure the workflow to send reminders before the scheduled appointment. This involves calculating the reminder time, formatting it, adding a delay, and finally sending the reminder message through either the Official Cloud API or QR Code API.

Calculate the Reminder Time. Add a New Action Step:

  • App: Date/Time Formatter (Pabbly)
  • Action Event: Add/Subtract Time

Configure the Formatter. In Date, select the start time of the event mapped from Calendly. In Expression, add the time offset for when you want the reminder sent (e.g., -1 day for 24 hours before the event, or -3 hours for 3 hours before).

Save and Test. Click Save and Send Test Request. The result will show the calculated date and time for the reminder, e.g., 2024-06-16T18:30:00.000000Z.

Format the Reminder Date. Add a New Action Step:

  • App: Date/Time Formatter (Pabbly)
  • Action Event: Format Date with Timezone

Configure the Formatter. In Date, use the result from the Add/Subtract Time step. In From Format, select YYYY-MM-DDTHH:mm:ssZ. In To Format, choose YYYY-MM-DD HH:mm:ss.

Save and Test. Click Save and Send Test Request. The response will display the correctly formatted date and time.

Add a Delay for the Reminder. Add Another Action Step:

  • App: Delay (Pabbly)
  • Action Event: Add Time Delay

Configure the Delay. In How Much Delay Do You Want to Put in Workflow?, use the result from the Format Date step.

Save and Test. Click Save and Send Test Request. Verify that the delay matches the intended reminder time.

Send the Reminder Message For Official Cloud API Accounts

Create the Reminder Message. Add an Action Step:

  • App: WhatsApp Cloud API
  • Action Event: Send Template Message

Set Up the Template.  Open Meta’s WhatsApp Manager. Create a template for the reminder, similar to the confirmation template. Use variables to include event details like the name, date, time, and location. Submit for revision.

Map the Variables. Back in Pabbly, map the variables for the template as we did before:

  • For Recipient Mobile Number, use the phone number mapped from Calendly (formatted correctly).
  • For body fields (e.g., event name, date, etc.), map the corresponding Calendly fields and formatter results.

Test the Message. Click Save and Send Test Request. Confirm the message was sent successfully.

This is how the final workflow in Pabbly will look for Official Cloud API accounts.

Send the Reminder Message For QR API Accounts

Create the Reminder Message. Add an Action Step:

  • App: API (Pabbly)
  • Action Event: Execute API Request

Set Up the API Request. Once again, select the following parameters:

  • Custom Request Method: POST
  • API Endpoint URL: Use the Send Direct Message endpoint from your platform’s API documentation.
  • Payload Type: JSON

Create the actual message. Configure the JSON Payload with the actual parameters and message:

{
“number”: “<Formatted phone number from Pabbly>”,
“type”: “text”,
“message”: “Hi, your event <Calendly mapping> is scheduled for <Formatter mapping> at <Location mapping>.”,
“instance_id”: “<Your instance ID>”,
“access_token”: “<Your access token>”
}
Replace <> placeholders with mapped fields and your platform credentials.

Test the API Request. Click Save and Send Test Request. Confirm that the response is accepted and the reminder was sent.

This is how the final workflow in Pabbly will look for QR API accounts.