alertin
v1.0.4
Published
Alertin Bulk SMS Service From Refined IT Solutions
Downloads
18
Maintainers
Readme
alertin
alertin
is a JavaScript library from Refined IT Solutions for sending SMS using our Alertin Bulk SMS Service.
The alertin
package contains only the functionality necessary to send SMS components. It is typically used together with NodeJS applications.
Note: alertin
Bulk SMS Service is not a free of cost service. Register and Get the access credentials from our website alertin.co.in.
Usage
const alertin = require('alertin');
// Creating Alertin Client
let alertInClient = alertin.client({
username : "USERNAME",
accessKey : "ACCESS_KEY"
});
alertInClient.sendSMS({
header : "HEADER", //Required
route : "ROUTE", //Required
message : "Hey, Good Morning.", //Required
recipients : ["9194XXX XXXXX","9195XXX XXXXX","9196XXXXXXXX","97XXXXXXXX"], //Required
entityId : "XXXXXXXXXXXXXXXXXXX", //Optional
templateId : "XXXXXXXXXXXXXXXXXXX" //Optional
})
.then(function(data) {
//Success or, Partial success
console.log(data);
})
.catch(function(err) {
//Failed
console.log(err);
});
API Documentation
alertin.client(params)
Creates and returns Alertin client object.
params
:
username
- required, Username of your Alertin panel.accessKey
- required, Generated Access Key from Alertin panel.
client.sendSMS(params)
Sending SMS to Recipients and returns Promise
. If the promise is success You will get messageid
from Response data
.
params
:
header
- required, SMS Header.route
- required, Route you want to send SMS.- Promotional –
A
- Transaction –
T
- SID –
SID
- Promo SID(DND) –
PD
- International –
I
- Promotional –
message
- required, Message Content.recipients
- required, Phonenumber(s) of SMS Receivers.phonenumber
, or array ofphonenumbers
entityId
, templateId
- These are Optional fields if you have added Your EntityId, TemplateId on Alertin Panel
entityId
- optional, DLT Registered Entity ID.templateId
- optional, DLT Registered Template ID.
Note: entityId
and templateId
are optional fields, but if you are able to parse the values, that will reduce the response time.
Sample Response
{
status: 200,
description: 'Partial success',
data: [
{
recipient : '9194XXX XXXXX',
messageid : null,
status : 'Invalid Header'
},
{
recipient: '9195XXX XXXXX',
messageid: '232XXXXX',
status: 'Success'
},
...
]
}