Yesterday, we published an open source APEX library that implements Twilio’s REST API. (Thanks to Aslam Bari for the huge contributions to this project). Twilio is an on-demand IVR platform that’s provides a simple API for companies to build scalable applications that make and receive phone calls. With Dreamforce right around the corner, Twilio and Appirio are sponsoring a developer’s contest around Twilio on the Force.com platform. To help you get started, I’m going to walk you through setting up the helper library in a Force.com Development Org.
Open Eclipse in the SVN Repository Exploring perspective. Add a new Repository Location (right click, New -> Repository Location) and enter the Location’s URL as http://twilioforce.googlecode.com/svn/trunk. You will see a folder structure like the one to the left after you’re connected. Right click the src directory and choose Export. Choose a location to export the source files click OK. Switch back to the Force.com perspective and open the project for your Force.com Developer’s org. Drag the contents of the /classes, /components, and /pages directories from your export into their respective directories in the Force.com project. Because this is a development org (same for Sandbox), and we don’t need APEX code coverage we’re able to just drag and drop the new source files to install them in the org. The auto-refresh capabilities of the Force.com IDE will deploy the files to your org in the background.
There’s a few key files to focus on while you’re getting started.
TwilioRestExample.cls -> APEX Class demonstrating the REST API. Don’t forget to add your Twilio AccountSID and AuthToken before trying to run the example. (Sign up for free if you haven’t already)
TestTwilioTags.page -> Visualforce page demonstrating the TwiML Visualforce Components. Twilio fetches TwiML from your site to drive the voice responses and instructions. Because these files need to be publicly available to Twilio, it requires you enable Force.com Sites.
The contest is scheduled to run until Dreamforce. Over the next week we’ll be posting examples and tutorials on how to use the library and extend the power of the Force.com platform with Twilio to bring voice to your applications! Here’s a few ideas to get things moving…
- Application that mimics Google Voice for Salesforce CRM (click to call, store user’s preferred number on User record)
- Case Management follow up (click to call)
- Call in campaigns (leads call in, submit info, links to Salesforce Campaign)
If you have any questions, please feel free to comment here or reach out. Appirio and Twilio look forward to seeing your submissions.