A simple wrapper for the Nexmo API
Ruby 1.9; Ruby 1.8 is not currently supported.
gem install nexmo
require 'nexmo'
nexmo = Nexmo::Client.new('...API KEY...', '...API SECRET...')
response = nexmo.send_message({
from: 'RUBY',
to: '...NUMBER...',
text: 'Hello world'
})
if response.success?
puts "Sent message: #{response.message_id}"
elsif response.failure?
raise response.error
end
Phone numbers should be specified in international format.
The Nexmo documentation contains a list of error codes which may be useful if you have problems sending a message.
Please report all bugs/issues via the GitHub issue tracker.