SMS via Twilio + Vapi
# support
d
Hello, I bought a Twilio number and did the A2P compliance, and did my assistant prompt correctly (i think) but I don't know what to do next, do I need to do anything on twilio side or do I have to add anything in vapi's side? Here is what I have but Im wondering if I need to set up the tool or sms anywhere else? { "type": "function", "function": { "name": "sendSms", "description": "Send an SMS with booking link to the customer", "parameters": { "type": "object", "properties": { "phoneNumber": { "type": "string", "description": "The customer's phone number" } }, "required": ["phoneNumber"] } } }
v
@Doug Hello! It sounds like you've made great progress with your Twilio number and A2P compliance. If you've set up your assistant prompt and have the
sendSms
function ready, you're on the right track. On the Twilio side, you should ensure that your number is configured to send SMS messages and that any webhooks or other configurations are set up to interact with your application. On the VAPI side, you need to make sure that you have the necessary credentials set up to use the Twilio service. This includes the
twilioAccountSid
,
twilioAuthToken
, and
credentialId
for the phone number you're using. If you've already configured these credentials, you can use the
sendSms
function by providing the
phoneNumber
parameter with the customer's phone number where you want to send the SMS. If you need to set up or verify your credentials in VAPI, please provide the
twilioAccountSid
,
twilioAuthToken
, and
credentialId
so that VAPI can handle the phone number correctly. Once everything is set up, you can test sending an SMS to ensure that the integration is working as expected. If you encounter any issues or have further questions, feel free to ask for more assistance.
You can continue this conversation by mentioning me in the message.
s
Below are the step\-by\-step instructions for the process: 1\. First, create a custom tool using Vapi, as you have already accomplished. 2\. Associate your tool with your assistant. 3\. Utilize explicit tool calls with prompts to trigger the tool most of the time. For further guidance, please refer to this link: 4\. Vapi will then send a server request to your server. 5\. Within your server, using the SDK of your choice, you can trigger the SMS by inferring the server message tool call payload/body. I have attached a document link for accomplishing this using TypeScript; however, you are welcome to use any technology of your preference: . Please let me know if you require any further assistance. NOTE: To infer the type, you can search for
ServerMessageToolCalls
at the following link: .
d
Hello thanks for the guidance! I don’t see any of the links you mentioned or documents you mentioned tho
s
@Doug because of no response closing this thread.
d
Sorry been trying to figure this out can I PM you so I can show you my code?
2 Views