Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

TwiML

Andrew Benton edited this page · 7 revisions

Home | Documentation | TwiML


TwiML support is based on the builder library. This document is not intended to be a guide to all TwiML Verbs and Nouns and their attributes. Consult the official TwiML documentation for the complete reference.

You can construct a TwiML response like this:

# build up a response
response = Twilio::TwiML::Response.new do |r|
  r.Say 'hello there', :voice => 'woman'
  r.Dial :callerId => '+14159992222' do |d|
    d.Client 'jenny'
  end
end

# print the result
puts response.text

This will print the following (except for the whitespace):

<?xml version="1.0" encoding="UTF-8"?>
<Response>
  <Say voice="woman">hello there</Say>
  <Dial callerId="+14159992222">
    <Client>jenny</Client>
  </Dial>
</Response>
Something went wrong with that request. Please try again.