0

i am trying to send sms using push bullet in nodeJs. From the push bullet docs, i got the function : "sendSMS", which can be used to send the message as SMS to a mobile phone. But, when i run the code, it is saying that "sendSMS is not a function". Can anyone please help me on this.

My nodejs code will be as follows :

var pusher = new PushBullet('MY-API-KEY');

var options = {
source_user_iden: 'uj*******K',           
target_device_iden: 'uj***************q', 
conversation_iden: '+91 7********6',      
message: 'Hello!' };    

pusher.sendSMS(options, function(err, response) {
console.log(response); });
Faariz Mohammed
  • 113
  • 1
  • 12

2 Answers2

1

You might have figured this out by now, but it looks like the package on NPMjs.com might be a bit outdated. If you install from the GitHub repository directly the sendSMS() function is available.

Here are instructions for installing directly from GitHub. How to install an npm package from GitHub directly?

Community
  • 1
  • 1
aafrey
  • 21
  • 2
0

I have used this package to send sms using node js

Install Package : npm install springedge

Example code to Use package ( Send SMS Push Request ):

var springedge = require('springedge');

var params = {
  'apikey': '', // API Key 
  'sender': 'SEDEMO', // Sender Name 
  'to': [
    '919019xxxxxxxx'  //Moblie Number 
  ],
  'message': 'test+message'
};

springedge.messages.send(params, 5000, function (err, response) {
  if (err) {
    return console.log(err);
  }
  console.log(response);
});

Its working good for me.

Serve
  • 69
  • 1
  • 7