I use twilio as a mobile validation mechanism, I have no previous experience using twilio, but looking at a sample PHP code, I used it in my code, but apparently it gave me an HTTP error 400 Bad request. Here is the code:
d = {
'TO' : '*** *** ****',
'FROM' : '415-555-1212',
'BODY' : 'Hello user, please verify your device using this code %s' % verNumber
}
try:
print account.request('/%s/Accounts/%s/SMS/Messages' % \
(API_VERSION, ACCOUNT_SID), 'POST', d)
except Exception, e:
return HttpResponse('Error %s' % e)
verNumber randomly generated, and the receiver number is checked in twilio.
I follow the exception and found this error
Error 400 The source 'From' phone number is required to send an SMS
What does it mean?
Thank.
source
share