octopush-ruby

A ruby library for use Octopush API.

Installation

You can install via

gem install octopush-ruby

or if you are using bundler, by adding to your Gemfile

gem 'octopush-ruby'

Usage

Setup user

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. = 'your_user_login'
  config.api_key = 'your_api_key'
end

# then you can initiate a new client to use

client = Octopush::Client.new

Send SMS

# 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)

Check Balance

client.get_balance

Update user options

client.edit_options({answer_email: '[email protected]', sms_alert_type: 'FR'})

Create sub account

client.('Name', 'LastName', 'Raison', '234', 'FR')

Credit sub account

client.('[email protected]', '500', 'FR')