Giter Site home page Giter Site logo

twilio's Introduction

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 www.twilio.com/docs/index 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', 'http://mysite.com/connected_call')
Twilio::Recording.list

Responding to Twilio

When Twilio calls your application URL, your response must use the Twilio Markup XML (www.twilio.com/docs/api_reference/TwiML/). 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 = Twilio::Verb.new { |v|
  v.say "The time is #{Time.now}"
  v.hangup
}
verb.response

Installation

gem install twilio

Contributing

  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 (www.rubyinside.com/why-using-require-rubygems-is-wrong-1478.html)

Testing

  • Currently using RSpec

  • Tested with REE 1.8.7, MRI 1.9.2, MRI 1.9.3, and JRuby 1.6.5

Copyright Phil Misiowiec, Webficient LLC. See LICENSE for details.

Contributors

  • Kyle Daigle

  • Yuri Gadow

  • Kyle Humberto

  • Vlad Moskovets

  • Jonathan Rudenberg

  • Mark Turner

  • Jeff Wigal

  • Alex K Wolfe

twilio's People

Contributors

alexkwolfe avatar amerine avatar jsmecham avatar kdaigle avatar philm avatar phlipper avatar srushti avatar titanous avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

twilio's Issues

Incompatible with Rails 3.1

Currently, the gem doesn't work with rails 3.1 because of the builder dependency (rails 3.1 needs builder 3.0).

Twilio::Call.get Conflict With Mongoid2

Mongoid2 monkey patches all objects with a get function which overwrites the Twillio::Call.get function making it return the SID as a string instead of a HTTParty response.

Don't think this is really your problem but it would be nice to have an alias for the method.

bad link

Link to article in google cache is down.

OpenSSL::SSL::SSLError when sending SMS

I get this when I tried to send my first SMS:

OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
from /Users/dball/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/net/http.rb:586:in connect' from /Users/dball/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/net/http.rb:586:inconnect'
from /Users/dball/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/net/http.rb:553:in do_start' from /Users/dball/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/net/http.rb:542:instart'
from /Users/dball/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/net/http.rb:1035:in request_without_newrelic_trace' from /Users/dball/.rvm/gems/ree-1.8.7-2011.03@decisiv/gems/newrelic_rpm-2.14.1/lib/new_relic/agent/instrumentation/net.rb:16:inrequest'
from /Users/dball/.rvm/gems/ree-1.8.7-2011.03@decisiv/gems/newrelic_rpm-2.14.1/lib/new_relic/agent/method_tracer.rb:193:in trace_execution_scoped' from /Users/dball/.rvm/gems/ree-1.8.7-2011.03@decisiv/gems/newrelic_rpm-2.14.1/lib/new_relic/agent/instrumentation/net.rb:15:inrequest'
from /Users/dball/.rvm/gems/ree-1.8.7-2011.03@decisiv/gems/httparty-0.7.7/lib/httparty/request.rb:69:in perform' from /Users/dball/.rvm/gems/ree-1.8.7-2011.03@decisiv/gems/httparty-0.7.7/lib/httparty.rb:390:inperform_request'
from /Users/dball/.rvm/gems/ree-1.8.7-2011.03@decisiv/gems/httparty-0.7.7/lib/httparty.rb:358:in post' from /Users/dball/.rvm/gems/ree-1.8.7-2011.03@decisiv/gems/twilio-3.0.0/lib/twilio/sms.rb:10:inmessage'

I presume this is because Twilio is using a self-signed cert or one with a hostname mismatch, but being new to httparty, I'm not sure the best way to solve this. Perhaps, if this is the expected state of affairs, it would be appropriate for the twilio gem to embed the cert it expects?

twilio gem 3.0.1 and builder 3.0

Hi,

It seems twilio 3.0.1 requires buidler ~> 2.1.2, but rails 3.1.0.rc4 requires builder ~> 3.0.0. Is it possible to update the dependencies ?

Best regards,

Julien

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.