简体   繁体   English

通过 Twilio C# API 检索 SMS 对话伙伴列表

[英]Retrieving list of SMS Conversational partners via Twilio C# API

I'm using the Twilio C# helper library in my SMS .NET project successfully, but I have a performance/optimization question:我在我的 SMS .NET 项目中成功使用了 Twilio C# 帮助程序库,但我有一个性能/优化问题:

Currently, in order to refresh my app's list of unique conversational partners, I'm basically returning a date-filtered list via MessageResource.Read like:目前,为了刷新我的应用程序的唯一对话伙伴列表,我基本上是通过 MessageResource 返回一个日期过滤的列表。阅读如下:

MessageResource.Read(dateSentAfter:=New DateTime(DatePart(DateInterval.Year, dtOldestMessageDate), DatePart(DateInterval.Month, dtOldestMessageDate), DatePart(DateInterval.Day, dtOldestMessageDate), 0, 0, 0))

...just so I can compile a list of the unique conversational partners by juggling/sorting the resulting list. ...只是这样我就可以通过杂耍/排序结果列表来编译独特的对话伙伴列表。

Given that I could have many messages to/from any/all partner(s), it seems rather inefficient.鉴于我可以向/来自任何/所有合作伙伴发送许多消息,这似乎相当低效。

Is there a method I'm missing that could simply return a list of unique conversational partners' phone numbers and the datetime of the last SMS (in or out) with them?是否有一种我缺少的方法可以简单地返回唯一对话伙伴的电话号码列表以及最后一条短信的日期时间(输入或输出)?

Below are the best practices for SMS logging, I would suggest maintaining the logs on your side/in your data store, rather than having Twilio store them and using the REST API to obtain them.以下是 SMS 日志记录的最佳实践,我建议将日志保存在您身边/数据存储中,而不是让 Twilio 存储它们并使用 REST API 来获取它们。

Best Practices for SMS Message Logging - Recommendations for maintaining messaging records SMS 消息记录的最佳实践 - 维护消息记录的建议

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM