I created a trial account in twilio and installed twilio using
pip install twilio
on ubuntu 14.04 LTS.
below is my python code to send sms
from twilio.rest import TwilioRestClient account_sid = "MY TEST ACCOUNT SID" auth_token = "MY TEST ACCOUNT TOKEN" client = TwilioRestClient(account_sid, auth_token) print "running!!" sms = client.sms.messages.create(body="All in the game, yo", to="+91MYNUMBER", from_="+1MY_TWILIO_NUMBER") print sms.sid print sms.status
While running this python file, I get below log errors from twilio.
Traceback (last last call): File "/home/software/ws/extra/scripts/test.py", line 40, from _ = "+ 1MY_TWILIO_NUMBER") File "/usr/local/lib/python2.7/ dist-packages / twilio / rest / resources / sms_messages.py ", line 167, in the creation return self.create_instance (kwargs) File" /usr/local/lib/python2.7/dist-packages/twilio/rest/resources/ base.py ", line 365, in the file create_instance data = transform_params (body)) File" /usr/local/lib/python2.7/dist-packages/twilio/rest/resources/base.py ", line 200, in request resp = make_twilio_request (method, uri, auth = self.auth, ** kwargs) File "/usr/local/lib/python2.7/dist-packages/twilio/rest/resources/base.py", line 164, in make_twilio_request uri = resp.url, msg = message, code = code) twilio.rest.exceptions.TwilioRestException: HTTP error 400: phone number + 1MY_TWILIO_NUMBER was not It is a valid phone number or short code for your account.
I checked that my number has the ability to voice, SMS and MMS.
I checked this error on here . then I tried with the number +15005550006 , it works, but I never get sms on my mobile phone. The message was sent to a queue that is never processed.
runnnign!! SM3f51b1c3e5ad43d38bd548cfada14175 queued
What am I missing? why i don't get sms?