The Twilio Verify Data Connector uses Twilio to send one-time codes to users so they can authenticate themselves. It can be used to verify email addresses and phone numbers, as well as part of a multi-factor authentication strategy.
This Data Connector extends the functionality of the Twilio Data Connector.
Once installed and added to a Form, you can access this Data Connector in the Form's server event scripts using: connectors.verjio.twilio.verify
.
twilio.verify.createService
create a Twilio verification service.
twilio.verify.sendToken
sends a verification token (code) to the specified recipient.
twilio.verify.checkToken
checks the verification token returned by the user matches the one sent.
Code Example:
// Create a new verification service
const service = connectors.verjio.twilio.verify.createService("myService", 5);
// Save the service id
if (service) {
// Send a verification code
const verification = connectors.verjio.twilio.verify.sendToken(service.sid, '+441234567890');
// Wait for user to enter code
const code = <user input>
// Check the user-provided verification code
const status = connectors.verjio.twilio.verify.checkToken(
service.sid,
'+441234567890',
code,
{ VerificationSid: verification.sid } );
// If the code was correct, the status will be `approved`
if (status === connectors.verjio.twilio.verify.status.APPROVED) {
// success!
}
}
For comprehensive information on how to use and develop applications with this Data Connector please refer to the Support section.
The Installation section has instructions on installing it into your Workspace.
Complete JavaScript API documentation for this Data Connector can be found in the Documentation section.