无服务器 Phone 使用 Twilio Verify 和 Twilio Functions 进行验证

Serverless Phone Verification with Twilio Verify and Twilio Functions

我正在尝试从 https://www.twilio.com/blog/serverless-phone-verification 实施项目以使用 SMS TOTP 验证 phone 号码。

当我创建新函数时,Twilio Functions 给出的 url 是 https://isabelline-badger-5492.twil.io/sendTOTP

我已将 VERIFY_SERVICE_SID env 变量指向正确的值“VAxxxxxxx”。

但是我收到如下错误。哪里不对请指教

Verify 函数本身工作正常,但当从 Functions 触发时,它会抛出以下错误。

{
    "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"
    }
}

确保您的 Twilio 函数正在使用的 Twilio 帮助程序库是最新的(3.29.2 太旧了,无法使用这个较新的功能)。如果使用基于控制台的功能,您可以找到并设置版本 here, for twilio. Make sure to click save. The latest helper library version as of this response is 3.37.1。这将解决问题。