Send an One Time Password (OTP) via the Twilio SMS gateway
Problem this snippet solves: This snippet makes it possible to send an One Time Password (OTP) via the Twilio SMS gateway. This snippet uses iRuleLX and the node.js twilio package to interact with t...
Updated Jun 06, 2023
Version 2.0Nov 16, 2018
I didn't try that myself, but according to the docs you should use something like this:
// Download the helper library from https://www.twilio.com/docs/node/install
// Your Account Sid and Auth Token from twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);
client.messages
.create({
body: 'Phantom Menace was clearly the best of the prequel trilogy.',
messagingServiceSid: 'MG9752274e9e519418a7406176694466fa',
to: '+441632960675'
})
.then(message => console.log(message.sid))
.done();