Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A Ruby wrapper for the Nexmo API

tag: v0.2.1

Fetching latest commit…


Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 README.txt
Octocat-spinner-32 Rakefile
Octocat-spinner-32 nexmo.gemspec
A simple wrapper for the Nexmo API (

Install via rubygems:

  gem install nexmo

Either require it, or add it to your Rails Gemfile:

  require 'nexmo'

  gem 'nexmo'

Construct a client with your Nexmo API credentials:

  nexmo ='...KEY...', '...SECRET...')

The underlying HTTP object is easily accessible. For example, you may want
to adjust the SSL verification when testing locally:

  nexmo.http.verify_mode = OpenSSL::SSL::VERIFY_NONE

Use the send_message method to send an SMS, passing the API parameters
as a hash:

  response = nexmo.send_message({
    from: 'RUBY',
    to: '...NUMBER...',
    text: 'Hello world'

If the response is successful you can access the message id, and if it's
a failure you can either check the error message or choose to raise the
error as an exception:

  if response.success?
    # store response.message_id
  elsif response.failure?
    # check response.error.message
    # raise response.error

Chunky bacon.
Something went wrong with that request. Please try again.