Created
May 20, 2009 17:31
-
-
Save levicole/114967 to your computer and use it in GitHub Desktop.
twillio api
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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