Reputation:
I'm using https://www.twilio.com to send messages.
A user can also reply to a message. The problem is how can I track which message the user is replying to?
For example, I've sent 2 messages to a user then the user response is on twilio phone number. How can I track that this response belong to which message?
Upvotes: 1
Views: 399
Reputation: 652
SMS messages are stateless, so replies back to the same Twilio number for two different messages aren't easily distinguishable. If possible, use one of the excellent solutions SimonR91 has offered. If you must use the same Twilio number, a simple way to keep track of conversations between phone numbers is by using HTTP cookies. The cookies can store a simple value representing the 'step' or 'state' of the message. Or use it as a key to session or a larger data structure to track a more complex object.
See the Guide to SMS Conversation Tracking or Twilio Skills Training for more information.
Upvotes: 0
Reputation: 167
If you are sending multiple messages to one recipient then there must be some unique identifier for you to work off.
Sorry it's not a definitive answer but I think you will struggle to get one for this issue.
Upvotes: 1