0.0.7 • Published 9 years ago
touchsms v0.0.7
touchSMS
The offical helper library to send SMS with touchSMS
Installation
npm install touchsmsUsage
var touchSMS = require('touchsms');
// access token & token id can be generated at https://platform.touchsms.com.au/apis/Send SMS
var sms = new touchSMS('access_token', 'token_id'); 
var smsOptions = {
    number: 61491570156,
    message: 'hello world',
    senderid: 'touchSMS'
}
var result = sms.sendSms(smsOptions);
result.then(function(data) {
    var json = JSON.parse(data);
    console.log(json);
});Output
{ 
  code: 200,
  errors: 0,
  message: ''
}View User Details
var result = sms.users();
result.then(function(data) {
    var json = JSON.parse(data);
    console.log(json);
});Output
{ 
  username: 'john.doe@sandbox',
  credits: 5000,
  senderid: 'sandboxAPI',
  mobile: '61491570156',
  code: 200 
}Examples
Examples can be found in examples directory.
npm examples/sendsms.js
npm examples/users.jsTests
Tests run through a Sandbox URL with Sandbox credentials.
  You can update the tests with your own credentials and remove the final true parameter on the touchSMS constructor.
npm test