Skip to content

Instantly share code, notes, and snippets.

@jdx
Created June 14, 2013 05:30
Show Gist options
  • Save jdx/5779658 to your computer and use it in GitHub Desktop.
Save jdx/5779658 to your computer and use it in GitHub Desktop.
sending twilio texts in ruby
require 'rest-client'
TWILIO_ACCOUNT_SID = "YOUR_TWILIO_ACCOUNT_SID"
TWILIO_AUTH_TOKEN = "YOUR_TWILIO_AUTH_TOKEN"
TWILIO_NUMBER = 'YOUR_TWILIO_NUMBER'
RestClient.post "https://#{TWILIO_ACCOUNT_SID}:#{TWILIO_AUTH_TOKEN}@api.twilio.com/2010-04-01/Accounts/#{TWILIO_ACCOUNT_SID}/SMS/Messages", {
"From" => TWILIO_NUMBER,
"To" => '+19712227154',
"Body" => "BEWD Rocks!",
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment