Skip to content

Instantly share code, notes, and snippets.

@mustmodify
Created January 21, 2012 16:26
Show Gist options
  • Save mustmodify/1653208 to your computer and use it in GitHub Desktop.
Save mustmodify/1653208 to your computer and use it in GitHub Desktop.
attempt to get Nexmo gem to send SMS
jw@eagle:/projects/saw/www$ ruby -v
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux]
jw@eagle:/projects/saw/www$ irb
1.9.3p0 :001 > require 'nexmo'
=> true
1.9.3p0 :002 > n = Nexmo::Client.new( ENV['NexmoKey'], ENV['NexmoSecret'] )
=> #<Nexmo::Client:0x0000000096be28 @secret="some_secret", @key="some_key", @headers={"Content-Type"=>"application/x-www-form-urlencoded"}, @http=#<Net::HTTP rest.nexmo.com:443 open=false>>
1.9.3p0 :004 > n.send_message({from:'Ruby', to:'3373263121', text: 'this is a test message.'})
=> #<struct Nexmo::Failure error=#<Nexmo::Error: Message rejected by upstream path>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment