MSG91 / sendotp-node

38 stars 24 forks source link

not working with aws lambda #25

Closed apoorv1997 closed 5 years ago

apoorv1997 commented 5 years ago

exports.handler = async (event, context, callback) => { const SendOtp = require('sendotp'); const sendOTP = new SendOtp('260981AZN8sH3O5c551802'); sendOTP.send(mobileNum,"611332", (error, data) => { if(err) { return err; } else { const response = { statusCode: 200, body: data.message, }; return response; } })

this is my lambda function and when i invoke the api endpoint i get null as result and nothing more. The function block of sendOTP is not working.