infobip
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

Infobip npm version

Infobip API Client for Node.js using Infobip API

Installation

$ npm install --save infobip

Usage

Basic messaging example

var infobip = require('infobip');
 
//Initialize the client
var client = new infopib.Infobip('username', 'password');
 
//Set the message
var message = {from: "InfoSMS", to : "41793026727", text : "My first Infobip SMS"};
 
//Send an SMS
client.SMS.send(message,function(err, response){
   console.log(response);
});
 

SMS to multiple destinations

//Set the message
var message = [{from: "WineShop", to : ["41793026727", "41793026834"], text : "Hey Mike, delicious Istrian Malvazija is finally here. Feel free to visit us and try it for free!"}];
 
//Send an SMS
client.SMS.send(message,function(err, response){
   console.log(response);
});
 

Bulk messaging example

//Set the message
var messages = [
    {from: "WineShop", to : "41793026727", text : "Hi Jenny, we have new French Merlot on our shelves. Drop by our store for a free degustation!"},
    {from: "WineShop", to : "41793026834", text : "Hey Mike, delicious Istrian Malvazija is finally here. Feel free to visit us and try it for free!"}
    ];
 
//Send an SMS
client.SMS.sendBulk(messages,function(err, response){
   console.log(response);
});
 

Promise are supported

 
client.SMS.send(message).then(res => console.log(res)).catch( err=> console.log(err));
 

License

This library is licensed under the Apache License, Version 2.0

Package Sidebar

Install

npm i infobip

Weekly Downloads

555

Version

0.1.0

License

MIT

Unpacked Size

11.8 kB

Total Files

17

Last publish

Collaborators

  • oreofeolurin