user4429180
user4429180

Reputation:

Tracking Twilio messages response that response belongs to which message

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

Answers (3)

beanserver
beanserver

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

srob
srob

Reputation: 167

If you are sending multiple messages to one recipient then there must be some unique identifier for you to work off.

  1. Use a different CLID
  2. Don't send a message until a reply has been received
  3. Ask user to quote a reference in the reply
  4. Match words to expected response text per message
  5. Set a timeout on sent SMS to receive a reply

Sorry it's not a definitive answer but I think you will struggle to get one for this issue.

Upvotes: 1

Serg Chernata
Serg Chernata

Reputation: 12400

Send the message from different phone numbers?

Upvotes: 1

Related Questions