Code-forever
Code-forever

Reputation: 67

Cannot send otp sms by using Twilio in spite of have Verified Caller IDs

I am learning how to send OTP code messages to verify phone numbers using Twilio, I am coding using java spring boot. Currently I have finished coding the API to send the code but when running the API, I keep getting the following error:

enter image description here

I checked again in the Verified Caller IDs section and my number was added when I registered my account:

enter image description here

But I don't understand why the API keeps reporting an error and doesn't send any SMS to my number: { "status": "FAILED", "message": "The number +8496763XXXX is unverified. Trial accounts cannot send messages to unverified numbers; verify +8496763XXXX at twilio.com/user/account/phone-numbers/verified, or purchase a Twilio number to send messages to unverified numbers" }

and I already bought a Twilio phone number: twilio.phoneNumber=+18052836183

Please help me fix this error. Thank you.

Upvotes: 0

Views: 386

Answers (1)

Anadi
Anadi

Reputation: 754

1. If Twilio Trial Account OR Number Not Verified:

It seems that you are still using Twilio trial account and Twilio trial accounts can only send messages to verified numbers (as the error is clearly mentioning that yours is a trial account). Did you verify the number you are trying to send the message?

From Twilio - "If you are using a Twilio Trial Account, you need to verify any non-Twilio phone numbers you wish to send SMS, Voice, or WhatsApp OTP messages."

Please follow this link.

2. Number Already Verified:

If the number is already verified and you’re still having the issues, there may be another reason like Twilio account balance, format of the phone number or the message service configuration.

You can check Twilio console if there is any error message.

Upvotes: 0

Related Questions