Msg91 API for node.js
npm install msg91-templateid --save
This is a fork from msg91 by Hiren Soni to support Msg91 API with DLT Template Id
- You need to register your sender Id at Dlt
- You need to approve your msg teplate at Dlt
// Provide sender Id that has been approve by DLT
var msg91 = require("msg91-templateid")("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";
// provide the approved DLT TemplateId that has been associated with the senderId
msg91.send(mobileNo, "MESSAGE","TEMPLATE_ID", function(err, response){
console.log(err);
console.log(response);
});
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);
});
1 - Promotional Route
4 - Transactional Route