fiskeben.dk


Meninger med mening

KeySMS

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

Installation

To install KeySMS, just run gem install keysms or download the gem from RubyGems.

Requirements

You need to register as a user and get an API key from KeySMS. Sign up here.

Usage

To send an SMS is a three-step operation:

  1. Create a new instance of the SMS sender: sms = Keysms::SMS.new
  2. Authenticate: sms.authenticate(“your username”, “your API key”)
  3. Send: sms.send(“Your message”, “phone number”)

If you need to send the same message to more than one receiver, just use an array of phone numbers as the second argument.

In the unlikely event of something going wrong, the gem will raise an exception:

  • NoValidReceiversError: If one of the receivers is an invalid phone number.
  • NotAuthenticatedError: If either your username or API key is wrong.
  • SMSError: General, unhandled errors.

Support
In case of bugs or unexpected behaviour, please use the issue tracker at Github.

If you need any help using the gem, you can send me an email at ricco@fiskeben.dk.

For issues related to you KeySMS account, please contact Keyteq. I am in no way related to Keyteq and can’t help you with anything in that regard.

Source code

KeySMS is open source. Get the source code from the Github repo here.

Donate

If you like, you can buy something from my Amazon.com wish list.

My Amazon.com Wish List