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 (6) 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) Force.com 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 Force.com Sites and Twilio

Using Force.com Sites and Twilio

Post by Michael Norton  (2012-01-23)

Status: Unverified
Level: intermediate

Problem

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

Solution

This example gives you a starting point for Force.com 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">
   <Response>
      <Say>Hello World</Say>
   </Response>
</apex:page>

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

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

<pre>http://twilioexample-developer-edition.na12.force.com/</pre>

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.

Discussion

Other use cases for integrating Salesforce.com 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.

References

Other recipes that you may find interesting:

Share

Recipe Activity - Please Log in to write a comment

Be the first to comment.

X

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 Force.com. 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.