A NodeJS based API wrapper implementation for OneWaySMS SMS Gateway provider.
npm install node-onewaysms-api
var OneWaySMS = require('node-onewaysms-api');
var config = {
endpoint: "ex: http://gateway.onewaysms.ph:10001",
apiusername: "ex: API_USERNAME",
apipassword: "ex: API_USERPASSWORD"
};
var sms = new OneWaySMS(config);
function handleResult(error, result) {
if (error) {console.log(error); return};
console.log(result);
}
// You can include more numbers separated by a comma
var numbers = ['09178009900'];
var normalText = "God is good, all the time.";
var payload = {
from: 'TEST',
to: numbers,
message: normalText,
ascii: true
};
sms.send(payload, handleResult);
var unicodeText = "神は、すべての時間良いです";
var payload = {
from: 'TEST',
to: numbers,
message: unicodeText,
ascii: false
};
sms.send(payload, handleResult);
var transactionId = '1603020018593';
sms.status(transactionId, handleResult);
sms.balance(handleResult);
- 1.0.0 - Initial Release
MIT