gpt4 book ai didi

Twilio REST API : request messages after sid

转载 作者:行者123 更新时间:2023-12-03 20:21:16 27 4
gpt4 key购买 nike

问题

使用 Twilio REST API,我只想请求尚未下载的消息。似乎最干净的方法是仅下载指定 SID 之后的消息。

文档中没有的信息

Twilio filter docs没有这个选项。他们只描述 to , from , 和 date_sent .

但是,Twilio 似乎确实具有此功能。您可以在他们的 paging information 中看到,那个nextpageuri包含 AfterSid .

浏览网站时,URL包含/user/account/log/messages?after=SMXXXXXX
到目前为止我尝试过的

使用 twilio-ruby 客户端,我尝试了以下操作但没有成功:

list = @client.account.sms.messages.list({after: 'SMXXXXXX'})

list = @client.account.sms.messages.list({AfterSid: 'SMXXXXXX'})

list = @client.account.sms.messages.list({after_sid: 'SMXXXXXX'})

最佳答案

来自 Dan Markiewicz - Twilio 客户支持

Unfortunately, we do not support filtering by this field in our API at this time. Your best option would be to get the DateCreated info on the SID you want to filter by and then use that to filter the messages by only those sent after that date. Since the date filter only supports filtering down to the day, it may return some number of unwanted messages that were sent that day but before the message you want to filter by. However, each message in the list will have a full date_created field down to the second, so you should be able to filter these out fairly easily on your end. This should produce the result you need.

关于Twilio REST API : request messages after sid,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21648371/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com