New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

sms_traffic_sdk

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sms_traffic_sdk

  • 0.0.7
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

SmsTraffic

Gem Version Maintainability Coverage CI

Ruby Gem as a software development kit (SDK) that facilitates interaction with the SMS Traffic HTTP API (smstraffic.ru/api). This gem provides a convenient wrapper to integrate SMS Traffic services within Ruby applications, allowing for easy sending of SMS messages and checking delivery statuses.

Features

  • Send SMS messages to single or multiple recipients.
  • Check the delivery status of sent messages.
  • TODO: Support for various message formats and encodings.

Installation

Add this line to your application's Gemfile:

gem 'sms_traffic_sdk'

And then execute:

$ bundle

Or install it yourself as:

$ gem install sms_traffic_sdk

Usage

Define settings:

# initializers/sms_traffic.rb
require 'sms_traffic_sdk'

SmsTraffic.configure do |config|
  config.login = 'login'
  config.password = 'password'
  config.originator = 'default_originator'
  config.server = 'https://api.smstraffic.ru'
  config.debug = true
  config.debugger = Rails.logger
end

Initialize sms:

sms = SmsTraffic::Sms.new('phone', 'text', 'originator') # initialize sms, originator by default from settings
# =>  #<SmsTraffic::Sms:0x0000 @errors=[], @message="text", @originator="default_originator", @phone="phone", @status="not-sent">

Send it and get sent sms id and dispatch code:

sms.deliver # send sms. returns sms id or dispatch code if something went wrong
# => true
sms.id # get sms id
# => '123456789'

Get current sms status and update it:

sms.status # get sms delivery status
# => 'sent'
sms.update_status # updates sms delivery status. returns status or status check response code on error
# => 'delivered'

Get any sms status:

response = SmsTraffic.status(sms_id) # status - sms delivery status unless error or return error
reply = response.reply
# => #<SmsTraffic::Client::StatusReply:0x0000>
status = reply.status
# => "Delivered"
reply.hash
# => 
# {"error"=>nil,
#  "submition_date"=>"2024-07-15 11:36:25",
#  "send_date"=>"2024-07-15 11:36:25",
#  "last_status_change_date"=>"2024-07-15 11:36:25",
#  "sms_id"=>"865149797164801235",
#  "status"=>"Delivered"}

Contributing

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

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install.

License

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

Contact

If you have any questions or feedback regarding SMS Traffic SDK, please feel free to contact us via GitHub issues or directly by email at i@golifox.ru.

Acknowledgments

  • Thanks to the SMS Traffic team for providing the API that this gem is based upon.
  • Anyone who contributes to this project is greatly appreciated.

For more information please visit SMS Traffic API docs.

FAQs

Package last updated on 18 Oct 2024

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