0.0
No release in over 3 years
Low commit activity in last 3 years
A ruby library for use Octopush API
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0

Runtime

>= 0
 Project Readme

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: 'some@email.com', sms_alert_type: 'FR'})

Create sub account

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

Credit sub account

client.credit_sub_account('sub_account@email.com', '500', 'FR')