We've implemented Twilio Verify's SMS service, and it works 99% of the time. However, we ran into an issue recently where an SMS was unable to be delivered and produced error codes 30005 and 30006.
The problem is that those error codes are not returned in the response when the verification instance is first created. All I get is a 201 and the status is pending.
I tried setting up a webhook using https://www.twilio.com/docs/verify/verify-events but the payload I received was different from what's in the console log. The webhook says the delivery status is "SENT" but the console log shows "Underliverable" with the 30005 error. There's no error code key in the webhook event payload.
So, my question is, how am I supposed to build error handling around these error codes when there's seemingly no way programmatically to know they resulted in an error? I've tried using every available ID key to search the messages API, but they always return no results.
I can't seem to find documentation on this either.
Meanwhile, my user is left waiting for a code that will never arrive because his mobile carrier, unbeknownst to him, has blocked the message. AND my app doesn't even know an error occurred.
Top comments (0)