<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Sahil Suman]]></title><description><![CDATA[Sahil Suman]]></description><link>https://blog.sahilsuman.me</link><generator>RSS for Node</generator><lastBuildDate>Mon, 20 Apr 2026 08:03:24 GMT</lastBuildDate><atom:link href="https://blog.sahilsuman.me/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Scheduling Appointments via SMS using Vapi]]></title><description><![CDATA[I have seen that many people on Discord face difficulties setting up appointments using Vapi. Therefore, I'll provide a tutorial to help you schedule meetings effectively and ensure it's ready for production.
One disadvantage of this method is that y...]]></description><link>https://blog.sahilsuman.me/scheduling-appointments-via-sms-using-vapi</link><guid isPermaLink="true">https://blog.sahilsuman.me/scheduling-appointments-via-sms-using-vapi</guid><dc:creator><![CDATA[Sahil Suman]]></dc:creator><pubDate>Thu, 25 Apr 2024 20:36:53 GMT</pubDate><content:encoded><![CDATA[<p>I have seen that many people on Discord face difficulties setting up appointments using Vapi. Therefore, I'll provide a tutorial to help you schedule meetings effectively and ensure it's ready for production.</p>
<p>One disadvantage of this method is that you may need to handle the entire process via voice call. Issues might arise in getting the data correctly formatted. For instance, you may have encountered problems like the Large Language Model (LLM) being unable to identify today's date, or failing to collect data accurately for use in custom functions. Sometimes, the synthesiser speaks too quickly when announcing available time slots, among other issues.</p>
<p>However, this method will enable you to schedule meetings without errors. Since it's manually done by users, your only task will be to send the message with the meeting link.</p>
<p><strong>Tools which we will be using to achieve it:</strong></p>
<ol>
<li><p>Vapi</p>
</li>
<li><p>Pipedream</p>
</li>
<li><p>Twilio</p>
</li>
<li><p>Calendly</p>
</li>
</ol>
<h3 id="heading-step-by-step-guide-to-setup-the-scheduling-appointments-via-sms-using-vapi">Step-by-Step Guide to Setup the Scheduling Appointments via SMS using Vapi:</h3>
<p>If you are already familiar with Vapi or used it before then you might know what my next step will be it is simply to add System Prompt and custom functions. Apart from it, you can select the best LLM Models (GPT 4 is usually the best choice in most of the cases), Transcriber and Voice.</p>
<p>System Prompt:</p>
<pre><code class="lang-plaintext">When the user needs to schedule a meeting, you will execute the schedule_meeting function with the parameter phone_number, which contains the phone number from the user details section.

[User Details]

Phone Number: {phone_number}
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1713190396502/47d83e51-6b88-4084-9c2f-6b739d549cb0.png" alt class="image--center mx-auto" /></p>
<p>Create a new workflow with the name schedule_meeting and then change the Event Data to HTTP body only and HTTP Response to be Return a custom response from your workflow.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1713192937400/8ec2001a-9e73-49cd-96d5-2cc581f3551f.png" alt class="image--center mx-auto" /></p>
<p>Now, we need to setup the calendly account and connect it via Pipedream using create scheduling link action in calendly. After, this you need to connect your calendly account and then select the meeting link followed by this you need to provide how many times a user can use this link to book the meeting. After doing this all it will look something like this</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1713193424523/d4198cce-2713-498e-ae8e-d55e76df3b0d.png" alt class="image--center mx-auto" /></p>
<p>Now, press test and then create a new flow related to sending sms using twilio and connect your account and fill the complete details you want to send the message from which number and to whom (you will get this data from the custom function call) leave this part for now we will setup while configuring our function call in vapi. Also, setup the message body by click on copy path on the booking_url and setup the your message followed by pass the booking_url by the path that you copied. After all this, It will look like this after it is</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1713193366167/e4037591-2e97-4ed4-9d1f-442e164e32f1.png" alt class="image--center mx-auto" /></p>
<p>Now, finally setup one more flow of HTTP response data and then copy and paste this JSON data. After this it will look like this</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1713193549352/1dc278ee-d6b3-43ef-b6e6-ef7b4f4d823b.png" alt class="image--center mx-auto" /></p>
<p>Now, let's set the function call on our Vapi Dashboard by going to vapi dashboard then to functions and create a new functions and put all these details as given below.</p>
<pre><code class="lang-plaintext">fuction_name: schedule_meeting
description: Schedule a meeting by sending a Calendly invite link via SMS.

Parameters: phone_number
description: User's phone number, including the country code

Server URL: https://eotukmj0fohftzu.m.pipedream.net (Replace it with your URL which you got at the starting of the schedule_meeting flow)
</code></pre>
<p>After this it will look something like this</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1713191948534/c6d57f03-9d02-48d3-8c29-5fd2bffc154a.png" alt class="image--center mx-auto" /></p>
<p>Now, click on the setup pipedream and use this sample payload</p>
<pre><code class="lang-plaintext">{
  "phone_number": "+14154232938"
}
</code></pre>
<p>and click on the test button</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1713193732156/709bac19-d5a7-4232-9436-889058bebea3.png" alt class="image--center mx-auto" /></p>
<p>Now, you will get a request on the Pipedream of how your HTTP body will look like when a user wants to schedule a meeting. After this go to the pipedream then select that post request and you will have the access to the phone number. It will look something like this</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1713193894707/c63266d6-b674-42f1-8dac-c3dcd32e241b.png" alt class="image--center mx-auto" /></p>
<p>Now, finally add the customer phone number where you want to send the data using this data. After setting up it will look something like this</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1713194066421/9cd7ec7a-4d30-4992-97c3-2d742358c9ae.png" alt class="image--center mx-auto" /></p>
<p>Now, just press deploy button and let move to the next step which is to import the twilio phone number for inbound call</p>
<p>After this, go to the phone number import your number fill all your necessary data and import your number.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1713191690398/a415cb9f-127f-45d3-bcf5-3c6ae65e4866.png" alt class="image--center mx-auto" /></p>
<p>Now, these parts must be pretty clear but you might be wondering why you put {phone_number} in this way and how we are going to get the phone number of the user.</p>
<p>Well, to do this we need to set up an assistant with a URL. Why? Basically, I am currently setting up this flow for the inbound call which means when someone calls to your bot number. For outbound call, you just need to configure it via /call api endpoint and pass the phone_number directly through Pipedream from your CRM tool.</p>
<p>Now, let's create workflow for the inbound call in Pipedream and plug in the webhook URL in the dashboard.</p>
<p>Create a new workflow with the name inbound call and then change the Event Data to HTTP body only and HTTP Response to be Return a custom response from your workflow. After the press continue and you will get a webhook url. You need to copy it</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1713191511873/1efc0e32-ced1-4897-96f8-5597cd592210.png" alt class="image--center mx-auto" /></p>
<p>Now go to settings and add your Server URL</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1713191612754/0ce27a69-58db-4227-a459-34e80ffe2318.png" alt class="image--center mx-auto" /></p>
<p>After this whenever you will call to your bot number which is the Twilio number that you setup you will get a request in your pipedream server which will contain the user details.</p>
<p>Now call your bot number with your other number so that you can see the request payload in the pipedream setup. Also, add the return http response flow after this It will look like this</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1713191920918/1edb005d-6c5b-4f9e-9001-4cffc1182b3a.png" alt class="image--center mx-auto" /></p>
<p>After this, just click on the return_http_response configure and paste this below code but make sure to change the schedule_meeting url with your pipedream url.</p>
<pre><code class="lang-plaintext">{
    "assistant": {
        "name": "Schedule Meeting",
        "voice": {
            "voiceId": "jennifer",
            "provider": "playht"
        },
        "model": {
            "model": "gpt-4",
            "messages": [
                {
                    "role": "system",
                    "content": "When the user needs to schedule a meeting, you will execute the schedule_meeting function with the parameter phone_number, which contains the phone number from the user details section.\n\n[User Details]\n\nPhone Number: {phone_number}"
                }
            ],
            "provider": "openai",
            "functions": [
                {
                    "name": "schedule_meeting",
                    "async": false,
                    "serverUrl": "https://eotukmj0fohftzu.m.pipedream.net",
                    "parameters": {
                        "type": "object",
                        "properties": {
                            "phoneNumber": {
                                "type": "string",
                                "description": "User's phone number, including the country code"
                            }
                        }
                    },
                    "description": "Schedule a meeting by sending a Calendly invite link via SMS.",
                    "serverUrlSecret": ""
                }
            ],
            "maxTokens": 250,
            "temperature": 0.7
        },
        "recordingEnabled": true,
        "firstMessage": "",
        "voicemailMessage": "",
        "endCallFunctionEnabled": false,
        "endCallMessage": "",
        "transcriber": {
            "model": "nova-2",
            "language": "en",
            "provider": "deepgram"
        },
        "clientMessages": [
            "transcript",
            "hang",
            "function-call",
            "speech-update",
            "metadata",
            "conversation-update"
        ],
        "serverMessages": [
            "end-of-call-report",
            "status-update",
            "hang",
            "function-call"
        ],
        "dialKeypadFunctionEnabled": false,
        "hipaaEnabled": false
    }
}
</code></pre>
<p>After this, it will look something like this</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1713192460101/975b9b5e-6c5c-41e6-852c-aef7bf8bd78d.png" alt class="image--center mx-auto" /></p>
<p>Now press deploy and Voila it is done. Now, you can call on your number and schedule the meeting.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1713194445602/08912176-dd12-4016-b227-ad99698157a3.png" alt class="image--center mx-auto" /></p>
]]></content:encoded></item></channel></rss>