从Twilio获取和删除SMS消息的最佳方法是什么?

时间:2022-09-16 14:30:48

I am using twilio.sugar to download my SMS messages. I have a dotnet service downloading them on a timer, processing the messages, and sending back responses. Something like this:

我正在使用twilio.sugar下载我的短信。我有一个dotnet服务,它在定时器上下载,处理消息,并发回响应。像这样的东西:

Twilio.sugar.Model.PhoneAutomation(Account).SMSMessageList.sms_messages()

This works, but I think I'm just getting the 50 most recent messages. What I want are the messages that are new since the last time I checked. My preference would be to delete them as/after I download them like POP3. If that's not possible, how are Twilio users supposed to prevent reprocessing the same messages? I get the impression that other's would like to do it this way but are similarly not finding a way to delete messages. My current solution is asinine. I'm saving a list of every sid that I process and just skipping those every time I download the list. If that lists goes bad, my program will reprocess a bunch of commands. So far from optimal that it hurts. I'm guessing that I'm missing something obvious or I'm not using this as intended. Thanks for your help!

这有效,但我想我只是得到了50条最新消息。我想要的是自上次检查以来新消息。我喜欢将它们删除为/我像POP3一样下载后删除它们。如果那是不可能的,那么Twilio用户应该如何防止重新处理相同的消息?我得到的印象是,其他人希望这样做,但同样没有找到删除邮件的方法。我目前的解决方案是asinine。我正在保存我处理的每个sid的列表,并且每次下载列表时都会跳过这些列表。如果该列表变坏,我的程序将重新处理一堆命令。到目前为止,它最终会受到伤害。我猜我错过了一些明显的东西,或者我没有按照预期使用它。谢谢你的帮助!

1 个解决方案

#1


0  

I don't know about twilio.sugar but the SMS/Messages REST API is deprecated.

我不知道twilio.sugar但不推荐使用SMS / Messages REST API。

There's a new Messages API that also supports the HTTP DELETE.

还有一个新的Messages API也支持HTTP DELETE。

Check if there's something like this in twilio.sugar:

检查twilio.sugar中是否有类似的内容:

https://www.twilio.com/docs/api/rest/message

#1


0  

I don't know about twilio.sugar but the SMS/Messages REST API is deprecated.

我不知道twilio.sugar但不推荐使用SMS / Messages REST API。

There's a new Messages API that also supports the HTTP DELETE.

还有一个新的Messages API也支持HTTP DELETE。

Check if there's something like this in twilio.sugar:

检查twilio.sugar中是否有类似的内容:

https://www.twilio.com/docs/api/rest/message