Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sms_box

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sms_box

  • 0.2.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

SmsBox

mnc smsBox® v6.4 -- HTTP XML API client

Installation

Add this line to your application's Gemfile:

gem 'sms_box'

And then execute:

$ bundle

Or install it yourself as:

$ gem install sms_box

Usage

Generic Usage

Load and SMSBox

require 'sms_box'
client = SMSBox.client 'http://pro.smsbox.ch:8047/Pro/sms/xml',
  {
    :username => 'myuser',
    :password => 'mypass'
  }

Client can be configured within a block

client = SMSBox.client 'http://pro.smsbox.ch:8047/Pro/sms/xml' do |c|
  c.username = 'myuser'
  c.password = 'mypass'
end

To send a request, a Request object needs to be instantiated and passed to client.request

request = SMSBox::WebsendRequest.new.tap do |r|
  r.service = 'TEST'
  r.text = 'This is a test message.'
  r.receivers = [
    '+41790000001',
    '+41790000002',
    '+41790000003',
  ]
end
res = client.request request

The bang method request! can be used to automatically raise an SMSBox::RequestException when request failed.

res = client.request! request # raises SMSBox::RequestException when response.error? == true

The status of the request can be checked on the response object

res.success?
# or
res.error?
# The error type is stored as string in res.error

Implemented Requests

  • WEBSEND (with multiReceiver)

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

FAQs

Package last updated on 01 May 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc