i am using Twilio API to send and receive sms from the customers.
Every time i send the sms to my customers, i store the feilds like to
, body
in to my database.
I have implemented the API for send message that works fine and am simply saving the fields in to my database.
My Problem
When i receive SMS from my customers to my twilio number. i want to get the fields like from number
and the body
and save to my databse.
i looked that the documentation here
https://www.twilio.com/docs/api/twiml
https://www.twilio.com/blog/2012/04/get-started-with-twilio-sms-receiving-incoming-sms-quickstart.html
But this only shows how to send a response to customer when a message is received.
I want to save the received sms in to my database.
Can someone help me top get the from number
and the message body
when a SMS is received. tnx..
Twilio evangelist here.
Twilio passes parameters in its HTTP request as form-encoded values, so you just need to use the REQUEST object to grab them:
$from = $_REQUEST['From']
The SMS Quickstart for PHP has a more detailed example.
Hope hat helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With