Udoh Success Benjamin Udoh Success Benjamin - 5 months ago 26
Python Question

I get the following error when trying to send a message to my phone number from my Twilio number

I get the following error when trying to send a message to my phone number from my Twilio number

from twilio.rest import TwilioRestClient as TRC
client = TRC('AC**********************edc','a7b***************************3d2') # connect to an account
client.messages.create(from_='+17********25', to='+23***********27', body='Twilio\'s the best!!') #create the message

Traceback
TwilioRestException: The From phone number +17*******25 is not a valid,
SMS-capable inbound phone number or short code for your account.


Can someone pls help me out?

Answer

Have you made sure to add the from_ number to your Twilio account on your Account's phone numbers page. Error 21606 may have more information regarding this issue. If this is using your "test credentials" you will want to have a look at test credentials.

Comments