Ruby interface to the Exotel API
Add this line to your application's Gemfile:
gem 'exotel'
And then execute:
bundle install --path gem/installation/path
Or install it yourself as:
gem install exotel
- httparty
sms_data = {
"From" => "<6-character Sender ID>"
"To" => "<Phone Number>"
"Body" => "<SMS content>"
}
Send sms as following
Exotel::SmsApi.set_credentials("<My Exotel SID>", "<My Exotel Token>")
response_hash = Exotel::SmsApi.send_sms(sms_data)
Query for sms status in following manner
- Using the sms sid generated directly
sms_sid = response_hash["Sid"]
sms_status_hash = Exotel::SmsApi.check_sms_status(sms_sid)
sms_status = sms_status_hash["Status"]
- Using the response hash generated on sending the sms
sms_status_hash = Exotel::SmsApi.check_sms_status(response_hash)
sms_status = sms_status_hash["Status"]
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request