Closed twe4ked closed 2 years ago
A bit more digging and a bit more reading of the documentation and I've worked this out.
From the docs:
The status of the verification. Can be: pending, approved, or canceled.
So this is the status of the actual “verification check” not the result of the check. I got a bit thrown by the API returning errors for things like invalid codes.
Issue Summary
We're currently upgrading from the
Authy
gem. We're using two APIs,verifications.create
andverification_checks.create
. I'm wondering what I need to check on the result object that those endpoints return.In this migration example the code is checking the
status
of the response:But in all my testing, the client will raise an exception. Details below.
Do I need to check the status of either of these calls? And if so, how do I create API requests that will exercise this path?
Steps to Reproduce
For the
verifications
API:From my testing, all “failure” cases will raise a
Twilio::REST::RestError
error, for instance an invalid phone number. Given that I'm assuming I don't need to check the result at all and if I don't see an exception I can assume the API call was successful.For the
verification_checks
API:As above, with my test example being an invalid
code
.Technical details: