Access the Nuntium API in Ruby.


gem install nuntium_api


gem 'nuntium_api'


require 'rubygems'
require 'nuntium'

api = Nuntium.new "service_url", "account_name", "application_name", "application_password"

message = {
  :from => "sms://1234",
  :to => "sms://5678",
  :body => "Hello Nuntium!",

# Send an Application Originated message.
response = api.send_ao message

# Can also send many messages at once
messages = [{:to => "sms://1", :body => 'One'}, {:to => "sms://2", :body => 'Two'}]
response = api.send_ao messages

# Simulate sending and get a list of candidate channels
api.get_candidate_channels_for_ao message

# Get all countries
countries = api.countries

# Get all carriers that belong to a specific country
carriers = api.carriers countries[0].iso2

# Get all channels
channels = api.channels

# Create a channel
api.create_channel {
  :name => "my_channel",
  :kind => "clickatell",
  :protocol => "sms",
  :direction =>"bidirectional",
  :enabled => true,
  :priority => 10,
  :configuration => {:password => "secret"}


Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.