Recipes by Category

App Distribution (2) Bundle logic, interface and services for distribution. App Logic (37) The Apex programming language, workflow and formulas for logic. Collaboration (5) The Salesforce Chatter collaboration platform. Database (29) Data persistence, reporting and analytics. Integration (33) Web Service APIs and toolkits for integration. Security (9) Platform, application and data security. Tools (4) tooling User Interface (36) Visualforce MVC and metadata-drive user interfaces. Web Sites (12) Public web sites and apps with optional user registration and login.
Beta Feedback
Cookbook Home » Using Sites and Twilio

Using Sites and Twilio

Post by Michael Norton  (2012-01-23)

Status: Unverified
Level: intermediate


You want to integrate your data with a telephony system, but don't know where to start.


This example gives you a starting point for Sites to host your Twilio Markup Language (TwiML) page(s). Before getting started, you need:

Now let's create the Twilio Hello World example. First, create a Visualforce page that serves up TwiML. For example, call the page TwilioHelloWorld.

<apex:page contentType="text/xml" sidebar="false" showheader="false">
      <Say>Hello World</Say>

Now you need to create a Site to host the page. See instructions here for creating a Site. Set your TwilioHelloWorld page as the Active Site Home Page, and remember to activate your site.

Now use your Site URL as the Voice URL for your Twilio Account Phone number. The Site URL should look something like this:


Once you have saved this in Twilio, try it out by dialing your new number. Note that if you're using a Twilio Sandbox number you will need to enter your pin, but if you purchase a number ($1 per month per number), no PIN is necessary.


Other use cases for integrating and Twilio:

  • Interactive voice response (IVR) that does Account look up based on Case Number/Customer ID.
  • Automatic Contact identification by Caller ID referencing the contact phone numbers.
  • No PIN required conference bridging.
  • Sending SMS messages to sales teams when new Leads arrive.


Other recipes that you may find interesting:


Recipe Activity - Please Log in to write a comment

Be the first to comment.


Vote to Verify a Recipe

Verifying a recipe is a way to give feedback to others and broaden your own understanding of the capabilities on When you verify a recipe, please make sure the code runs, and the functionality solves the articulated problem as expected.

Please make sure:
  • All the necessary pieces are mentioned
  • You have tested the recipe in practice
  • Have sent any suggestions for improvements to the author

Please Log in to verify a recipe

You have voted to verify this recipe.