0.0
Low commit activity in last 3 years
No release in over a year
Client for Terra SMS Provider API.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.2.22
~> 12.3
~> 3.9.0
~> 2.3

Runtime

~> 2.2
 Project Readme

TerrasmsApi

Ruby client for Terrasms API | Библиотека для API провайдера Terrasms

Table of Contents

  • Installation
  • Usage
    • Quick Demo
    • Exceptions
  • Contributing
  • License

Installation

Add this line to your application's Gemfile:

gem 'terrasms_api'

And then execute:

$ bundle

Or install it yourself as:

$ gem install terrasms_api

Usage

Quick demo

require 'terrasms_api'

First, create client using your access token:

client = TerrasmsApi.new(access_token: 'your.token')

After that simply do some request.

# send sms
# mandatory_attributes for mostly all requests:
# - login: your login for Terrasms auth
# - target: phone or email
# - sender: public name
# - message: sms body

client.post('send', mandatory_attributes)

Exceptions

def send_sms
  client.post('send', attrs)
rescue TerrasmsApi::RequestError, TerrasmsApi::ConnectionError => e
  puts e.message, e.backtrace
end
Name Description
TerrasmsApi::RequestError Request didn't succeed
TerrasmsApi::ConnectionError Connection didn't succeed

Testing

bundle exec rspec

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

License

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