twilio 对话跟踪 ID [英] twilio conversation tracking id

查看:28
本文介绍了twilio 对话跟踪 ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 twilio 创建一个聊天应用程序,但在跟踪多个用户和多个对话之间的对话时遇到问题.

I am creating a chat application with twilio but having an issue tracking conversations among multiple users and multiple conversations.

示例:

对话 -> userA &用户B

conversation -> userA & userB

conversation2 -> userA &用户B

conversation2 -> userA & userB

当我收到来自用户 A 的 SMS 消息时,当用户 A 在对话 2 中向用户 B 发送消息时,如何将其映射到对话 2?

When userA sends a message to userB in conversation2 when I receive a SMS message from userA how do I map it to conversation2?

我的期望:

我要找的是一个 ID,它要么是我提供的,要么是由 twilio 生成的,并在我发送 SMS 时提供给我.然后,当我收到来自 twilio 的短信时,我可以通过查看发送短信时存储的 ID 将其与对话进行匹配.

What I am looking for is an ID that is either provided by me or generated by twilio and given to me when I send the SMS. Then when I receive a SMS from twilio I can match it to a conversation by looking at the ID stored when the SMS was sent.

谢谢!

推荐答案

Twilio 开发人员布道者在这里.

Twilio developer evangelist here.

短信没有内置线程,因此仅使用一个电话号码是不可能的.您可以通过在手机上打开短信应用并尝试回复从某人那里收到的倒数第二条消息来向自己证明这一点.

SMS does not have threading baked in, so this is not possible with just one phone number. You can prove this to yourself by opening the SMS app on your phone and trying to respond to the second to last message you received from someone.

您有两个选择:

  1. 您坚持要求您的用户在话题中的消息中包含特定 ID,以便您可以解析消息并提取 ID 以将话题联系在一起.

  1. You insist that your users include a specific ID within messages in a thread so that you can parse the message and extract the ID to tie the threads together.

您在使用不同 Twilio 号码的相同用户之间进行单独对话.通过这种方式,您可以使用所使用的编号将线程绑定在一起.

You conduct separate conversations between the same users using different Twilio numbers. This way you can tie the thread together using the number that was used.

让我知道这是否有帮助.

Let me know if that helps at all.

这篇关于twilio 对话跟踪 ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆