Nexmo API wrapper
Add this line to your application's Gemfile:
gem 'nexmos'
And then execute:
$ bundle
Or install it yourself as:
$ gem install nexmos
# Nexmos specific clientclient= ::Nexmos::Message.new('api-key','api-secret')# get result from Nexmores=client.send_text(from: 'your number',to: '+1234567890',text: 'Hello world!')# check if send is successifres.success?puts"ok"elseputs"fail"endclient= ::Nexmos::Account.new('api-key','api-secret')res=client.get_balancemy_balance=res.valueYou can create config/initializer/nexmos.rb file with next content:
Nexmos.setupdo |n|
n.api_key='api_key'n.api_secret='api_secret'endAnd then you can call all clients without providing key and secret.
If you need to use Sandbox then you can set endpoint host with next content:
Nexmos.setupdo |n|
n.api_key='api_key'n.api_secret='api_secret'n.endpoint='http://rest-sandbox.nexmo.com'endMore details about api calls you can found in the lib/api.yml file.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create new Pull Request


