Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A Ruby gem for sending SMS via Keyteq's SMS service, KeySMS.

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 .gitignore
Octocat-spinner-32 Gemfile
Octocat-spinner-32 Gemfile.lock
Octocat-spinner-32 README.md
Octocat-spinner-32 Rakefile
Octocat-spinner-32 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.