Skip to content
A Ruby gem for sending SMS via Keyteq's SMS service, KeySMS.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

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


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


To send an SMS:

  • Create a new instance of the SMS sender: sms =
  • 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.


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.