Socket
Socket
Sign inDemoInstall

node-onewaysms-api

Package Overview
Dependencies
47
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    node-onewaysms-api

A NodeJS based API wrapper implementation for OneWaySMS SMS Gateway provider.


Version published
Weekly downloads
17
decreased by-32%
Maintainers
1
Install size
3.69 MB
Created
Weekly downloads
 

Readme

Source

node-onewaysms-api

A NodeJS based API wrapper implementation for OneWaySMS SMS Gateway provider.

Installation

npm install node-onewaysms-api

Usage

Initialize the 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);
}

Compose and send a normal SMS payload:

// 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);

Compose and send a Unicode encoded SMS payload:

var unicodeText = "神は、すべての時間良いです";
var payload = {
	from: 'TEST',
	to: numbers,
	message: unicodeText,
	ascii: false
};

sms.send(payload, handleResult);

Check the transaction Id of the message:

var transactionId = '1603020018593';
sms.status(transactionId, handleResult);

Check your credit balance:

sms.balance(handleResult);

Revision History

  • 1.0.0 - Initial Release

MIT

Keywords

FAQs

Last updated on 04 Mar 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc