Skip to content

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Playsms Client Library for Ruby

Borrowed heavily from Nexmo Ruby Library: https://github.com/Nexmo/nexmo-ruby

Gem Version Build Status

This is the Ruby client library for PlaySMS's API. To use it you'll need a PlaySMS system setup.

Installation

To install the Ruby client library using Rubygems:

gem install playsms

Alternatively you can clone the repository:

git clone git@github.com:WIU/playsms-ruby.git

Usage

Begin by requiring the playsms library:

require 'playsms'

Then construct a client object with your user and secret:

client = Playsms::Client.new(user: 'YOUR-API-USER', secret: 'YOUR-API-SECRET')

For production you can specify the PLAYSMS_USER and PLAYSMS_SECRET environment variables instead of specifying the key and secret explicitly.

SMS API

Send a text message

response = client.send_message(to: 'YOUR NUMBER', msg: 'Hello world')

unless response['data'].nil? || response['data'][0]['status'] != 'OK'
  puts "Sent message #{response['data'][0]['smslog_id']}"
else
  puts "Error: #{response['error_string']}"
end

Docs: https://github.com/antonraharja/playSMS/blob/master/documents/development/WEBSERVICES.md

API Coverage

  • Messaging
    • Send
    • Delivery Receipt
    • Inbound Messages
    • Search
      • Message
      • Messages
      • Rejections

License

This library is released under the MIT License

About

Ruby Library for the PlaySMS API

Resources

Stars

1 star

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages