Send an SMS Using Node.js
The Textmagic SMS Node.js wrapper can save you a lot of time, as it includes all the necessary API commands and tests. It only takes a few seconds to download it from GitHub and to install it into your own app or software. After installation, you’ll then be able to send text messages.
Get it now on GitHubInstallation Instructions
Quick Installation
Run the following command to install the Textmagic Node.js module using npm:
npm install textmagic-rest-client
Manual Installation
You can also clone the Textmagic API wrapper for Node.JS from the GitHub repository:
git clone git://github.com/textmagic/textmagic-nodejs.git
Requirements
The Node.js wrapper for the Textmagic API has the following requirements:
- Node.js v0.12.0 or higher
Sending an SMS Using Node.js (an example)
Below is an example of how to send a text message using Node.js:
var TMClient = require('textmagic-rest-client'); var c = new TMClient('username', 'C7XDKZOQZo6HvhJwtUw0MBcslfqwtp4'); c.Messages.send({text: 'test message', phones:'9990001'}, function(err, res){ console.log('Messages.send()', err, res); });
Support
If you need help with the wrapper, or if you have any suggestions for improvements and/or if you have any enquiries regarding the Node.js SMS gateway, please contact us by emailing [email protected].