A ruby library for use Octopush SMS API.
You can install via
gem install octopush-ruby
or if you are using bundler, by adding to your Gemfile
gem 'octopush-ruby'
First you need to setup an user login and api key to use with octopush. You can register at octopush.com to get one
require 'octopush-ruby'
# setup your own credentials
Octopush.configure do |config|
config.user_login = 'your_user_login'
config.api_key = 'your_api_key'
end
# then you can initiate a new client to use
client = Octopush::Client.new
# first needs to create a sms instance
sms = Octopush::SMS.new
# set your desired attributes
sms.sms_text = 'some text'
sms.sms_recipients = '+33600000000'
sms.sms_type = 'FR'
# then just send the sms with the client you created before
client.send_sms(sms)
client.get_balance
client.edit_options({answer_email: '[email protected]', sms_alert_type: 'FR'})
client.create_sub_account('Name', 'LastName', 'Raison', '234', 'FR')
client.credit_sub_account('[email protected]', '500', 'FR')