KeySMS is a Ruby gem for sending SMS messages using the Norwegian gateway, KeySMS.
To install KeySMS, just run gem install keysms or download the gem from RubyGems.
You need to register as a user and get an API key from KeySMS. Sign up here.
To send an SMS is a three-step operation:
- Create a new instance of the SMS sender: sms = Keysms::SMS.new
- Authenticate: sms.authenticate(“your username”, “your API key”)
- 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.
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 firstname.lastname@example.org.
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.
KeySMS is open source. Get the source code from the Github repo here.
If you like, you can buy something from my Amazon.com wish list.