Smsapi::Client
Smsapi::Client is a Ruby implementation for SMSAPI.pl gateway created by Ruby Logic
Fork by Poltrax
Installation
Add this line to your application's Gemfile:
gem 'smsapipl-client', '~> 1.0'
And then execute:
$ bundle
Or install it yourself as:
$ gem install smsapipl-client -v '~> 1.0'
Usage
Be sure you have a token. You can obtain it on SMSAPI.pl
require 'smsapi'
client = Smsapi::Client.new('your_secret_token')
credits = client.credits
credits.balance
credits.pro_sms_limit
credits.eco_sms_limit
credits.mms_limit
credits.vms_gsm_limit
credits.vms_stac_limit
sms = client.send_single 500500500, 'Text Message'
sms.status
sms.success?
sms.points
sms.status
sms.success?
sms.error?
sms.error_code
sms.error_message
sms = client.send_single 500500500, 'Text Message', test: '1'
sms = client.send_single 500500500, 'Text Message', from: 'Ruby Logic'
when = DateTime.new(2015, 10, 10)
sms = client.schedule_single 500500500, 'Text Message', when
bulk = client.send_bulk [500500500, 600600600, 7007007], 'Text Message', test: '1'
bulk.sent
bulk.sent.first.success?
bulk.sent.count
Development
After checking out the repo, run bin/setup
to install dependencies. Then, run bin/console
for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
. To release a new version, update the version number in smsapi.rb
, and then run bundle exec rake release
to create a git tag for the version, push git commits and tags, and push the .gem
file to rubygems.org.
Contributing
- Fork it ( https://github.com/ruby-logic/smsapi-client/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request