Backend/node_modules/msg91
2021-12-31 15:03:23 +05:30
..
.npmignore 20211231 commit 2021-12-31 15:03:23 +05:30
changlog.txt 20211231 commit 2021-12-31 15:03:23 +05:30
Gruntfile.js 20211231 commit 2021-12-31 15:03:23 +05:30
index.js 20211231 commit 2021-12-31 15:03:23 +05:30
index.min.js 20211231 commit 2021-12-31 15:03:23 +05:30
package.json 20211231 commit 2021-12-31 15:03:23 +05:30
README.md 20211231 commit 2021-12-31 15:03:23 +05:30
test.js 20211231 commit 2021-12-31 15:03:23 +05:30

Msg91

Msg91 API for node.js

NPM

Msg91 Installation

npm install msg91 --save

Msg91 Integration

Send SMS

var msg91 = require("msg91")("API_KEY", "SENDER_ID", "ROUTE_NO" );


// Mobile No can be a single number, list or csv string

var mobileNo = "XXXXXXXXXX";

var mobileNo = [ "XXXXXXXXXX", "XXXXXXXXXX", "XXXXXXXXXX" ];

var mobileNo =  "XXXXXXXXXX,XXXXXXXXXX,XXXXXXXXXX";

msg91.send(mobileNo, "MESSAGE", function(err, response){
    console.log(err);
    console.log(response);
});

Get Balance

msg91.getBalance(function(err, msgCount){
    console.log(err);
    console.log(msgCount);
});

// Get Balance for given Route.
msg91.getBalance("ROUTE_NO", function(err, msgCount){
    console.log(err);
    console.log(msgCount);
});

Msg91 Constants

ROUTE_NO

1 - Promotional Route
4 - Transactional Route