Skip to content

Instantly share code, notes, and snippets.

@levicole
Created May 20, 2009 17:31
Show Gist options
  • Save levicole/114967 to your computer and use it in GitHub Desktop.
Save levicole/114967 to your computer and use it in GitHub Desktop.
twillio api
# be sure to gem install httparty, its a GREAT gem for
# working with these types of RESTful This is just a starting point.
# You will probably want to add a few more methods to the class that
# sets the account_sid, and account_token.
require "httparty"
class TwilioCall
include HTTParty
base_uri "https://api.twilio.com/"
#this is just your account credentials, replace them with your credentials
basic_auth ACCOUNT_SID, ACCOUNT_TOKEN
# you will need to have some the required options in the options hash
# :Caller(your caller ID), :Called(the person calling), :url which is
# the location of the XML file you are using as our dial plan.
def place_call(options={})
@options = {:query => options}
self.class.post("/2008-08-01/Accounts/account_sid/Calls",)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment