Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Twilio API client

branch: master

Fetching latest commit…


Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 .gitignore
Octocat-spinner-32 CHANGELOG.rdoc
Octocat-spinner-32 Gemfile
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.rdoc
Octocat-spinner-32 Rakefile
Octocat-spinner-32 twilio.gemspec

Twilio Gem

The Twilio gem provides two major pieces of functionality: (1) a Ruby wrapper for the Twilio REST API and (2) response handlers based on the Twilio Markup XML (TwiML).

See for Twilio's API documentation.

Calling the Twilio REST API

First set your credentials by calling the connect method:

Twilio.connect('my_twilio_sid', 'my_auth_token')

Now call any of the Twilio classes:

Twilio::Call.make('1234567890', '9876543210', '')

Responding to Twilio

When Twilio calls your application URL, your response must use the Twilio Markup XML ( The Twilio gem makes this very easy by providing a Twilio Verb class.

For example, in a Ruby on Rails application, you could do the following inside a controller class:

Twilio::Verb.dial '415-123-4567'

and you can nest multiple verbs inside a block:

verb = { |v|
  v.say "The time is #{}"


gem install twilio


  1. Run 'bundle' from the command line to install dependencies

  2. Write test(s) for your patch

  3. Submit a pull request

Note: don't require 'rubygems' in any file (


Copyright © 2009-2011 Phil Misiowiec, Webficient LLC. See LICENSE for details.


  • Kyle Daigle

  • Yuri Gadow

  • Kyle Humberto

  • Jonathan Rudenberg

  • Mark Turner

  • Jeff Wigal

  • Alex K Wolfe

Something went wrong with that request. Please try again.