Skip to content

wecasa/octopush-ruby

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

octopush-ruby

A ruby library for use Octopush SMS 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.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

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.create_sub_account('Name', 'LastName', 'Raison', '234', 'FR')

Credit sub account

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

About

A ruby library for use Octopush API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 99.5%
  • Makefile 0.5%