deeej
deeej

Reputation: 387

Serverless Phone Verification with Twilio Verify and Twilio Functions error

I am trying to implement a project in Vuejs with this https://www.twilio.com/code-exchange/one-time-passcode-verification-otp. I deployed my functions through this.

I have a custom vuejs app that I’m using this in a form with.

Here is my front end function

verifyNumber() {

  var auMobilePrefix = “+61”;
  var m = this;
  m.mobileNumber = ‘’;
  m.mobileNumber = auMobilePrefix.concat(this.finalModel.mobile);
  // console.log(m.mobileNumber);

    const code = this.vcode;

    const data = new URLSearchParams();
    data.append(“to”, m.mobileNumber);
    data.append(“verification_code”, code);

    fetch(“https://verify-xxxx-xxxxx.twil.io/check-verify”, {
      method: ‘POST’,
      body: data
    })

    .then(response => response.json())
    .then(json => {
      if (json.success) {
        console.log(json.message);
      } else {
        console.log(json.message);
      }
    })
    .catch(err => {
      console.log(err);
    });
}

After I validate the code. I get the following error in console:

Verify-xxxx-xxxxx.twil.io/check-verify:1 Failed to load resource: the server responded with a status of 404 ()

MultiStepVerification.vue?280d:214 The requested resource /Services/VAxxxxxxx/VerificationCheck was not found

How do I resolve this issue?

Update

https://www.twilio.com/docs/verify/api/verification-check

This is actually the intended behaviour.

Twilio deletes the verification SID once it’s:

Under the verification service logs I noticed that the Status for my tests were Approved.

Upvotes: 0

Views: 200

Answers (1)

Alan
Alan

Reputation: 10771

Can you check the Twilio Helper Library version, to make sure it is current?

twilio-node changelog

You can manually add a Twilio helper library version to your Twilio Function NPM Dependencies to override the older version used by default, which is currently 3.29.2.

Displays Node Version and Twilio Helper Library Version

Upvotes: 1

Related Questions