Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
A Ruby gem for sending SMS via Keyteq's SMS service, KeySMS.
Ruby
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
.gitignore
Gemfile
Gemfile.lock
README.md
Rakefile
keysms.gemspec

README.md

KeySMS Ruby gem

The KeySMS gem is a Ruby gem for sending SMS messages through the Norwegian SMS gateway, KeySMS.

If you just need to run the gem, it's much easier just to install the gem:

gem install keysms

Requirements

In order to use KeySMS, you need to register as a user and get an API key from KeySMS.

Usage

To send an SMS:

  • Create a new instance of the SMS sender: sms = Keysms::SMS.new
  • Authenticate using your username and API key: sms.authenticate(username, key)
  • Send your message: sms.send(your_message, receivers)

Receivers can either be a single phone number (string) or a list of receivers.

Errors

KeySMS will raise an exception if something goes wrong:

  • NoValidReceiversError: If one or more of the receivers isn't a valid phone number.
  • NotAuthenticatedError: If either your username or API key isn't recognized by the gateway.
  • SMSError: General exception in case of unhandled/unknown errors.
Something went wrong with that request. Please try again.