Version 2 of the Verify API is now available! V2 has an improved developer experience and new features. Some of the features of the V2 API include:
- Twilio helper libraries in JavaScript, Java, C#, Python, Ruby, and PHP
- PSD2 Secure Customer Authentication Support
- Improved Visibility and Insights
You are currently viewing Version 1. V1 of the API will be maintained for the time being, but any new features and development will be on Version 2. We strongly encourage you to do any new development with API V2. Check out the migration guide or the API Reference for more information.
API Reference is available at https://www.twilio.com/docs/verify/api/v1
Authy::PhoneVerification.start
takes a country code, phone number and a method (sms or call) to deliver the code.
response = Authy::PhoneVerification.start(via: "sms", country_code: 1, phone_number: "111-111-1111")
if response.ok?
# verification was started
end
Authy::PhoneVerification.check
takes a country code, phone number and a verification code.
response = Authy::PhoneVerification.check(verification_code: "1234", country_code: 1, phone_number: "111-111-1111")
if response.ok?
# verification was successful
end