Send an SMS Using Ruby
The Textmagic API Ruby wrapper can save you a lot of time, as it includes all the necessary API commands and tests. It only takes a few seconds to download it from GitHub and to install it into your own app or software. After installation, you’ll then be able to send text messages.
Get it now on GitHubInstallation Instructions
Quick Installation
Run the following command to install the Textmagic Ruby helper using gem:
gem install textmagic-ruby
Manual Installation
You can also install the Textmagic Ruby helper from the Github repository using git. Run the following commands:
git clone [email protected]:textmagic/textmagic-rest-ruby.git cd textmagic-rest-ruby make test-install make install
Requirements
The Ruby wrapper for the Textmagic API has the following requirements:
- Ruby >= 1.9.3
- Bundler >=1.10
Sending an SMS using Ruby (an example)
Below you’ll find an example of how to send a text message using Ruby.
require 'rubygems' require 'textmagic-ruby' username = 'your_textmagic_username' token = 'your_textmagic_apiv2_key' client = Textmagic::REST::Client.new username, token params = {:phones => '999000000', :text => 'Hello from Textmagic Ruby.'} message = client.messages.create(params)
Support
If you need help with the wrapper, or if you have any suggestions for improvements and/or if you have any enquiries regarding the Ruby SMS API, please contact us by emailing [email protected].