I can help you out with this. FYI, I work with Authy. Is your intention to get an OTP code and subsequently verify the code automatically? Just out of curiosity, are you doing this for integration testing?
You could approach this with Authy by:
- Purchasing a Twilio VOIP number
- Setting the SMS webhook of the Twilio VOIP number to an API endpoint
- Requesting a Phone Verification or Authy 2FA OTP token to that number (NOTE: if you're requesting an Authy OneCode OTP, you will first have to register the number with Authy)
- At this point, the OTP will be delivered to your API endpoint via the SMS webhook
- Parse the OTP and verify the Phone Verification of Authy 2FA token.
If you are approaching this for testing, you can see a testing-sample app for both Phone Verification and Authy OneCode on Github.
Additional sample API calls are also available on Github.
Regards,
Josh @ Authy
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…