Reputation: 25554
I'm trying to use Twilio with Python but I just can't send SMS using the twilio.rest
My tests:
Python 2.6.5 (r265:79063, Jun 25 2011, 08:36:25)
[GCC 4.4.4 20100726 (Red Hat 4.4.4-13)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from twilio.rest import TwilioRestClient
>>> ACCOUNT_SID = "XXXXXXXXX"
>>> AUTH_TOKEN = "YYYYYYYYYY"
>>> client = TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN)
>>> message = client.messages.create(from_="+351999804432", to="+351123456789", body="message")
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/home/andre/workspace/some.pt/3rd_party/virtualenv_some/lib/python2.6/site-packages/twilio/rest/resources/messages.py", line 112, in create
return self.create_instance(kwargs)
File "/home/andre/workspace/some.pt/3rd_party/virtualenv_some/lib/python2.6/site-packages/twilio/rest/resources/base.py", line 328, in create_instance
data=transform_params(body))
File "/home/andre/workspace/some.pt/3rd_party/virtualenv_some/lib/python2.6/site-packages/twilio/rest/resources/base.py", line 180, in request
resp = make_twilio_request(method, uri, auth=self.auth, **kwargs)
File "/home/andre/workspace/some.pt/3rd_party/virtualenv_some/lib/python2.6/site-packages/twilio/rest/resources/base.py", line 147, in make_twilio_request
uri=resp.url, msg=message, code=code)
TwilioRestException: <unprintable TwilioRestException object>
Some clue on what is happening?
Best Regards,
Upvotes: 0
Views: 572
Reputation: 11
You should make sure you are sending to a twilio-verified number from a valid twilio number
Upvotes: 1