Search code examples
twiliotwilio-functions

Serverless Phone Verification with Twilio Verify and Twilio Functions


I am trying to implement the project from https://www.twilio.com/blog/serverless-phone-verification to verify phone number using SMS TOTP.

When I created new function the url given by Twilio Functions is https://isabelline-badger-5492.twil.io/sendTOTP

I have given the VERIFY_SERVICE_SID env variable to point to correct value ‘VAxxxxxxx’.

But I am getting error as below. Please advise what is wrong.

The Verify functions works fine by itself, but when triggered from Functions, it throws below error.

{
    "success": false,
    "message": {
        "status": 404,
        "message": "The requested resource /Services/VAxxxxxxx/Verifications was not found",
        "code": 20404,
        "moreInfo": "https://www.twilio.com/docs/errors/20404"
    }
}

Solution

  • Make sure the Twilio helper library your Twilio Functions are using is up to date (3.29.2 is to old to use this newer feature). If using the Console based functions, you can find and set the version here, for twilio. Make sure to click save. The latest helper library version as of this response is 3.37.1. This will fix the issue.