Socket
Socket
Sign inDemoInstall

msg91-promise

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    msg91-promise

Promise based API For MSG91 SMS Gateway. - It is not an official version of MSG91


Version published
Weekly downloads
6
decreased by-25%
Maintainers
1
Install size
42.7 kB
Created
Weekly downloads
 

Changelog

Source

[0.1.2] - 2017-11-16

Added

  • Update in README

[Released]

Readme

Source

msg91-promise

Promise based Msg91 API for node.js

NPM

Msg91 Installation

npm install msg91-promise -S
yarn add msg91-promise

APIs

ROUTE_NO

1 - Promotional Route
4 - Transactional Route

USAGE


const msg91 = require('msg91-promise');

const API_KEY = 'XXXXXXXXXXXXXXXXXXXX'; // Your API key
const SENDER_ID = 'TESTPR'; // Your sender id 
const ROUTE = 4; // transactional route

const msg91SMS = msg91(API_KEY, SENDER_ID, ROUTE);


const mobileNo = 'XXXXXXXXXX';
msg91SMS.send(mobileNo, 'MESSAGE')
  .then(response => console.log(response))
  .catch(err => console.log(err));

// can also send sms to an array of numbers
const mobileList = ['XXXXXXXXXX', 'XXXXXXXXXX', 'XXXXXXXXXX'];

msg91SMS.send(mobileList, 'MESSAGE')
  .then(response => console.log(response))
  .catch(err => console.log(err));

// mobile numbers can be inside a CSV file
const mobileNoCSV = 'XXXXXXXXXX,XXXXXXXXXX,XXXXXXXXXX';

// pass the CSV file containing mobile numbers
msg91SMS.send(mobileNoCSV, 'MESSAGE')
  .then(response => console.log(response))
  .catch(err => console.log(err));

// check your balance
msg91SMS.getBalance()
  .then(response => console.log(response))
  .catch(err => console.log(err));

// get balance for a particular route
msg91SMS.getBalance(ROUTE)
  .then(response => console.log(response))
  .catch(err => console.log(err));

Keywords

FAQs

Last updated on 16 Nov 2017

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