0
votes

I want to be able to send an sms using Twilio and then if the receiver of the message responds to the sms it will take the body of the message and save it into my database. I can send an sms from my application. My question is how do I receive the response. I know how to insert the response into the database.

Also, the sms is sent from a specific project with a unique id. I want to be able to somehow tag the message so when they reply back I can insert their reply back and reference it back to that project.

Thanks in advance for your help.

2

2 Answers

0
votes

To store the incoming message - You have to configure a message URL on this https://www.twilio.com/user/account/phone-numbers/incoming page. When your twilio number receives a message , twilio sends POST parameters to the message URL. On the message URL you can write a code to store the parameters on the database.

0
votes

Twilio evangelist here.

There is unfortunately no way to insert metadata into a SMS message. You can however use the Twilio phone number you are sending the message from as a unique identifier. When your user replies, check the From parameter passed by Twilio as part of its POST request to see how to associate the incoming message with your applications data.

Hope that helps.