I am using plivo for sending SMS to our users. I am implementing it with nodejs and as per the instructions of plivo's nodejs helper documentation I followed all the steps as given in the link below : plivo Nodejs helper official doc
Step 1. installed the library:
npm install plivo
Step 2: Initializing PlivoRestApi
var plivo = require('plivo');
var p = plivo.RestAPI({
authId: 'Your AUTH_ID',
authToken: 'Your AUTH_TOKEN'
});
Step 3: Triggering SMS
var params = {
'src': '1111111111',
'dst' : '2222222222',
'text' : "Hello, how are you?"
};
p.send_message(params, function (status, response) {
console.log('Status: ', status);
console.log('API Response:\n', response);
});
and i am getting error as follow:
Debug: internal, implementation, error
TypeError: Uncaught error: plivo.RestAPI is not a function
I am unable to find what is the exact issue with my code.