Skip to content

Repository files navigation

Client SMSApi

Code Climate | Test Coverage | Gem Version

For details visit SMSApi homepage

Installation

Add this line to your application's Gemfile:

gem'client_smsapi'

And then execute:

$ bundle

Or install it yourself as:

$ gem install client_smsapi

Configuration

The client needs your credentials. Configure them!

SMSApi.configuredo |config|
config.username='what_a_username'config.secret='what_a_secret'end

Rails users are recommended to put this code into initializer file such as config/initializers/smsapi.rb

Usage

message=SMSApi::SMS::Message::Eco.new(to: 48123456789,body: 'test')SMSApi::SMS::Client.new.send_message!(message)#<SMSApi::Response::Regular:0x007f82eca9ee78 @id=1440528348109731150, @points=0.07, @status=:ok>

.send_message! will raise an error in case of failure. There is also .send_message alternative available.

Test mode

You can use library in test_mode. Test mode will perform API request without sending a message and charging you.

message=SMSApi::SMS::Message::Eco.new(to: 48123456789,body: 'test')SMSApi::SMS::Client.new(test_mode: true).send_message!(message)#<SMSApi::Response::Regular:0x007f82eca9ee78 @id=1440528348109731150, @points=0.07, @status=:ok>

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/mentero/client_smsapi.

About

smsapi.pl ruby client

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages