Twilio - The From phone number xxx is not a valid, SMS-capable inbound phone

爱⌒轻易说出口 提交于 2020-04-30 05:35:05

问题


I want to use Twilio for verifying phone number of users registering on my app. As a backend, I have Parse.

I tried to send an SMS using the test credentials, so far I received a success message, but, I didn't received the SMS! I've tried to switch to the live credentials; however, I received the following:

{
    "code": 141,
    "error": {
        "status": 400,
        "message": "The From phone number +12025550162 is not a valid, SMS-capable inbound phone number or short code for your account.",
        "code": 21606,
        "moreInfo": "https://www.twilio.com/docs/errors/21606"
    }
}

I've also tried to replace the "From" Phone number to an alphanumeric sender ID, but that didn't work too!

What should I do in that case?


回答1:


Twilio developer evangelist here.

Firstly, test credentials don't actually send messages, they are simply there to test that you are making your API requests properly. Also note that they only work with specific numbers and only on a few endpoints.

In order to send SMS messages from Twilio, you need to buy and use a number from Twilio as your "From" number. Your number there doesn't look as though it is a Twilio number. You can buy numbers from your Twilio console.

My guess is that you're sending messages to US numbers. Alphanumeric sender IDs don't work in the US I'm afraid, you can see the countries that support it here.

Finally, if you're looking to verify your users' numbers, have you checked out Authy? They do phone verification as an API, as well as two factor authentication.

Let me know if this helps at all.



来源:https://stackoverflow.com/questions/38570799/twilio-the-from-phone-number-xxx-is-not-a-valid-sms-capable-inbound-phone

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!