Skip to content
This repository has been archived by the owner on Feb 26, 2020. It is now read-only.
/ keysms-gem Public archive

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

Notifications You must be signed in to change notification settings

fiskeben/keysms-gem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages