Nexmo Node Library
Nexmo is a cloud based SMS API that lets you send and receive high volume of messages at wholesale rates.
sudo npm install node-nexmo-api
var nexmo = ;nexmosms;
Look at the
test/ directory for more examples.
Before running tests change the values in the
To run the tests:
// Retrieve your current account balancenexmoaccount;
// Retrieve Nexmo's outbound pricing for a given countrynexmoaccount;
// Update your account settingsnexmoaccount;// want it to be much simpler?nexmoaccount;nexmoaccount;nexmoaccount;
// Get all inbound numbers associated with your Nexmo Accountnexmoaccount;
// Get available inbound numbers for a given country// Required parameters: country-code (ex: ES).// Optional parameter: pattern (ex: 7000)nexmonumber;nexmonumber;
// Purchase a given inbound number// Required parameters:// country-code : Country code (ex: ES).// msisdn : An available inbound number (ex: 34911067000)// Response:// Http Status 200 if successful purchase// Http Status 401 if wrong credentials// Http Status 420 if wrong parametersnexmonumber;
// Cancel an inbound number// Required parameters:// country-code : Country code (ex: ES).// msisdn : An available inbound number (ex: 34911067000)// Response:// Http Status 200 if successful purchase// Http Status 401 if wrong credentials// Http Status 420 if wrong parametersnexmonumber;
I'll be adding more examples soon, including a fun example application (probably an article?). Please fork and contribute and send me pull requests. This was done in 2 hours time, so there might be some bugs somewhere. All tests pass for now. If you found a bug, but lazy to implement the solution don't hesitate to leave behind at least a failing test so I can fix it immediately. :)
(The MIT License)
Copyright (c) 2011 Shripad K <email@example.com>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.