Bluehouselab::Sms

This is a simple client for sending SMS messages to mobile devices via the Bluehouselab API. http://www.bluehouselab.com/

Installation

Add this line to your application's Gemfile:

gem 'bluehouselab-sms'

And then execute:

$ bundle

Or install it yourself as:

$ gem install bluehouselab-sms

Usage

sms = Bluehouselab::Sms.new :api_key => "123", :app_id => "123", :sender => "010111111111"

#send an sms message
sms.send_message :type => :sms, :receivers => ["0102222222","01033333333"], :content => "Hello World"
# => { :message_ids => [["0102222222","100001"],["01033333333","100002"]], :success => true, :error => nil, :status_code => 200 }

#send an lms message
sms.send_message :type => :lms, :receivers => ["0102222222","01033333333"], :content => "Hello World", :subject => "Hello" }
# => { :message_ids => [["0102222222","100001"],["01033333333","100002"]], :success => true, :error => nil, :status_code => 200 }

#find if the message was delivered successfully
sms.result "100001"
# => {:error=>nil, :success=>true, :status_code=>200, :sent_time=>2015-08-28 06:49:05 UTC}

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake rspec to run the tests. You can also 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 version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/CosmicColor/bluehouselab-sms.

License

The gem is available as open source under the terms of the MIT License.