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

sms_aero

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sms_aero

  • 0.2.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

SmsAero

Gem Version Build Status Dependency Status Code Climate

HTTP(s) client to SMS Aero service API written on top of evil-client "framework".

Sponsored by Evil Martians

Synopsis

See operation specs for more verbose examples.

Initialize a client with user and password:

client = SmsAero.new user: "joe",        # required
                     password: "foobar", # required
                     testsend: true      # optional - to send test SMS

Then send requests:

answer = client.send_sms text: "Hello!",
                         to:   "+7 (909) 382-84-45",
                         date: "2100/01/12", # Date, Time, DateTime are accepted as well
                         type: 3 # see API docs for details

answer.result   # => "accepted"
answer.id       # => "38293"
answer.success? # => true (checks whether an id has been returned)
answer = client.check_status id: "38293"
answer.result # => "pending"
answer = client.send_sms text:  "Hello!",
                         group: "customers",
                         date:  Date.new("2100/01/12"),
                         type:  1

answer.result   # => "accepted"
answer.id       # => "894924"
answer.success? # => true (checks whether an id has been returned)
answer = client.check_sending id: "894924"
answer.result # => "pending"
answer = client.add_blacklist phone: "+7 (999) 123-45-67"
answer.result # => "accepted"
answer = client.add_group group: "baz"
answer.result # => "accepted"
answer = client.add_phone phone: "+7 (999) 123-45-67",
                          group: "customers",
                          fname: "John",
                          lname: "Paul",
                          lname: "Doe",
                          bday:  "1998/08/12",
                          param: "VIP"

answer.result # => "accepted"
answer = client.check_balance
answer.result  # => "accepted"
answer.balance # => 1973.2
answer = client.check_groups
answer.result   # => "accepted"
answer.channels # => ["customers", "employee"]
answer = client.check_senders sign: "qux"
answer.result # => "accepted"
answer.result # => ["peter", "paul"]
answer = client.check_sign sign: "qux"
answer.result # => "accepted"
answer.data   # => ["approved"]   
answer = client.check_tariff
answer.result # => "accepted"
answer.tariff # => { direct: 10.3, digital: 3.89 }
answer = client.delete_group group: "employee"
answer.result   # => "accepted"
answer = client.delete_phone phone: "+7 (999) 123-4567",
                             group: "customers"

answer.result   # => "accepted"
# checking existance & availability of phone number
answer = client.hlr phone: "+7 (999) 123-4567"
answer.result   # => "accepted"
id = answer.id  # => "12345", id of request

answer = client.hlr_status id
answer.result   # => "accepted"
answer.status   # => any of :available, :unavailable or :nonexistent

FAQs

Package last updated on 27 Apr 2018

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