1.0.4 • Published 7 months ago

alertin v1.0.4

Weekly downloads
-
License
Proprietary
Repository
-
Last release
7 months ago

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
  • message - required, Message Content.
  • recipients - required, Phonenumber(s) of SMS Receivers. phonenumber, or array of phonenumbers

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'
            },
            ...
        ]
    }
1.0.4

7 months ago

1.0.3

7 months ago

1.0.2

7 months ago

1.0.1

7 months ago

1.0.0

7 months ago