Trying to build appointment reminder using Twilio SMS in .net core. The problem is that a phone number could be associated with more than one user and a user can have multiple appointments in a day.
Is there anyway to associate an incoming sms either to webhook or studio to a particular ID? For example after a appointment reminder is sent through twilio, grab the sid through callback url and then a user confirms or cancels the appointment message, then look at the incoming sid and match it with the send sid?
is there any alternative to this? other than sending url to the user.
Thank you all.
CodePudding user response:
Twilio developer evangelist here.
I'm afraid that there is no concept of replying to a specific message within SMS. You can check this yourself by opening your SMS application on your phone and trying to reply to a message that was not the last message from someone. There is no option to do that, SMS messages are chronological and that is all.
You have some options for how to handle this though.
You could choose to only send messages to people that don't have an existing message you are waiting for a reply to, within an appropriate timeout.
You could purchase more than one number and send messages about different appointments for the same person using different numbers. That way you can associate the response to the original message based on the number you used to send the message. You should only need as many numbers as you have appointments per phone number per day.
Or you can send a URL to a user, as you suggested. Or an ID in the message that they have to include in their response. But those aren't great user experiences.