Giter VIP home page Giter VIP logo

client_smsapi's Introduction

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.configure do |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.

client_smsapi's People

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

rafath venethub

client_smsapi's Issues

two problems, besides good job ;)

cześć,

Jest problem z ładowaniem pliku: lib/client_smsapi/error/messages.yml
przy uruchamianiu aplikcji pojawia się błąd:

/home/vagrant/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/psych.rb:464:in `initialize': No such file or directory @ rb_sysopen - lib/client_smsapi/error/messages.yml (Errno::ENOENT)
        from /home/vagrant/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/psych.rb:464:in `open'
        from /home/vagrant/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/psych.rb:464:in `load_file'
        from /home/vagrant/.rvm/gems/ruby-2.2.2/gems/client_smsapi-0.2.0/lib/client_smsapi/response/error.rb:19:in `<class:Error>'
        from /home/vagrant/.rvm/gems/ruby-2.2.2/gems/client_smsapi-0.2.0/lib/client_smsapi/response/error.rb:5:in `<class:Response>'
        from /home/vagrant/.rvm/gems/ruby-2.2.2/gems/client_smsapi-0.2.0/lib/client_smsapi/response/error.rb:4:in `<module:SMSApi>'
        from /home/vagrant/.rvm/gems/ruby-2.2.2/gems/client_smsapi-0.2.0/lib/client_smsapi/response/error.rb:3:in `<top (required)>'
        from /home/vagrant/.rvm/gems/ruby-2.2.2/gems/client_smsapi-0.2.0/lib/client_smsapi/response.rb:1:in `require_relative'
        from /home/vagrant/.rvm/gems/ruby-2.2.2/gems/client_smsapi-0.2.0/lib/client_smsapi/response.rb:1:in `<top (required)>'
        from /home/vagrant/.rvm/gems/ruby-2.2.2/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `require'
        from /home/vagrant/.rvm/gems/ruby-2.2.2/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `block in require'
        from /home/vagrant/.rvm/gems/ruby-2.2.2/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:240:in `load_dependency'
        from /home/vagrant/.rvm/gems/ruby-2.2.2/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in `require'
        from /home/vagrant/.rvm/gems/ruby-2.2.2/gems/client_smsapi-0.2.0/lib/client_smsapi.rb:2:in `<top (required)>'
        from /home/vagrant/.rvm/gems/ruby-2.2.2@global/gems/bundler-1.10.6/lib/bundler/runtime.rb:76:in `require'
        from /home/vagrant/.rvm/gems/ruby-2.2.2@global/gems/bundler-1.10.6/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
        from /home/vagrant/.rvm/gems/ruby-2.2.2@global/gems/bundler-1.10.6/lib/bundler/runtime.rb:72:in `each'
        from /home/vagrant/.rvm/gems/ruby-2.2.2@global/gems/bundler-1.10.6/lib/bundler/runtime.rb:72:in `block in require'
        from /home/vagrant/.rvm/gems/ruby-2.2.2@global/gems/bundler-1.10.6/lib/bundler/runtime.rb:61:in `each'
        from /home/vagrant/.rvm/gems/ruby-2.2.2@global/gems/bundler-1.10.6/lib/bundler/runtime.rb:61:in `require'
        from /home/vagrant/.rvm/gems/ruby-2.2.2@global/gems/bundler-1.10.6/lib/bundler.rb:134:in `require'
        from /var/www/projects/przypominacz.us/reminder_app/config/application.rb:7:in `<top (required)>'
        from /home/vagrant/.rvm/gems/ruby-2.2.2/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:141:in `require'
        from /home/vagrant/.rvm/gems/ruby-2.2.2/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:141:in `require_application_and_environment!'
        from /home/vagrant/.rvm/gems/ruby-2.2.2/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:67:in `console'
        from /home/vagrant/.rvm/gems/ruby-2.2.2/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
        from /home/vagrant/.rvm/gems/ruby-2.2.2/gems/railties-4.2.5/lib/rails/commands.rb:17:in `<top (required)>'
        from bin/rails:9:in `require'
        from bin/rails:9:in `<main>'

i w opisie: jest config.secret a powinno być config.password

Poza tym super działa ;). Dzięki.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.