An easy way to use API SMS of www.smsfactor.com/ (www.smsfactor.com/api-sms/)
You can install sms_factor by adding this line in your Gemfile :
gem 'sms_factor'
And then :
bundle install
To use this gem, configure SmsFactor using your API information :
SmsFactor::Init.configure do |config| config.api_url = 'http://api.smsfactor.com' config.api_login = '<your_email@your_company.com>' config.api_password = '<your_password>' config.api_default_from = '<a_default_sender_name>' end
To send a SMS :
r = SmsFactor.sms('Hello World', '336++++++++') # to a single recipient r = SmsFactor.sms('Hello World', ['336++++++++', '336++++++++', '336++++++++']) # to multiple recipients r = SmsFactor.sms('Hello World', '336++++++++', 'Toto') # to override default from
To retrieve your credit after the sms was sent :
r.credit
Copyright © 2015 Julien Séveno