Created
April 11, 2015 09:17
-
-
Save philiph/e291da86603557c9e666 to your computer and use it in GitHub Desktop.
Sending an SMS with Twilio's Ruby library
This file contains hidden or 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
source "https://rubygems.org" | |
ruby "2.1.2" | |
gem 'twilio-ruby' |
This file contains hidden or 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
#!/usr/bin/env ruby | |
require 'twilio-ruby' | |
# put your own credentials here | |
account_sid = 'xxx' | |
auth_token = 'xxx' | |
# set up a client to talk to the Twilio REST API | |
@client = Twilio::REST::Client.new account_sid, auth_token | |
puts "Sending SMS..." | |
@client.account.messages.create({ | |
from: '+614xxxxxxxx', | |
to: '+614xxxxxxxx', | |
body: 'This is a test message from my Twilio ruby app.' | |
}) | |
puts "Done." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment