bulksms-service
v1.0.5
Published
Bulk SMS Service For NodeJS
Downloads
9
Maintainers
Readme
bulksms-service
bulksms-service
is a JavaScript library for sending Bulk SMS.
The bulksms-service
package contains only the functionality necessary to send SMS components. It is typically used together with NodeJS applications.
Note: bulksms-service
Bulk SMS Service is not a free of cost service. Register and Get the access credentials from your provide.
Usage
const bulksmsService = require('bulksms-service');
// Creating Bulk SMS Service Client
let bulkSMSServiceClient = bulksmsService.client({
username : "USERNAME",
accessKey : "ACCESS_KEY",
endPoint : "https://example.com"
});
bulkSMSServiceClient.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
bulksmsService.client(params)
Creates and returns Alertin client object.
params
:
username
- required, Username of your Alertin panel.accessKey
- required, Generated Access Key from Alertin panel.endPoint
- required, End Point of your Provider(domain).
bulksmsService.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'
},
...
]
}