Is there a way to send a conversation unique identifier to the Twilio webhook?

谁说胖子不能爱 提交于 2021-02-11 13:55:50

问题


I'm trying to figure out if there is a way to uniquely identify the conversation an SMS is replying to without having to buy a new 'from' phone number each time. I know that one can store whatever you want in cookie or session storage, but those both expire in different ways. What I really want is somehow to pass or use an existing unique id for each separate conversation. So that I can map the messages to the right conversations.

I'm not sure but I wonder if its possible to send a expireless unique identifier to a webhook. So that I know which conversation it should be mapped to?

If not is there some way to use the conversation api to achieve the effect of tracking which sms messages belong to which conversations?


回答1:


A common challenge, since SMS is a stateless, is to try and match up the specific request with the response. Twilio Studio's Send and Wait for Reply widget does this by only allowing one sent message (to the destination number) until there is a response OR the configurable timeout parameter expires, and then moving to the next widget, so keeping state of the interaction.

As you said, if you are attempting to have multiple simultaneous threads to the same destination phone number, you will need to use a unique From number to separate out the threads - from the received parties perspective, they don't see threading in their SMS client, and cannot pick which question to respond to.

Best Practices for SMS Message Logging

Additional Questions Q: Can a user send a customer identifier for a message, or is only the Twilio-defined SID available?

A: Only the Twilio-defined SID is available.



来源:https://stackoverflow.com/questions/61527631/is-there-a-way-to-send-a-conversation-unique-identifier-to-the-twilio-webhook

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!