Closed jeremygpeterson closed 10 years ago
@jeremygpeterson I'm taking a look at this and it's currently working for me. Let's see if we can debug what's going on.
What versions of
twilio-ruby
rails
Also what does 24.hours.ago.strftime("%Y-%m-%d") print out at the rails console for you?
I'm using twilio-ruby (3.11.4), rails (3.1.11) and ruby 1.9.3p194.
The 24.hours.ago.strftime("%Y-%m-%d") command prints out "2013-10-20".
I'm trying to determine if this is a problem with the twilio-ruby library or the REST API. I'm assuming you have curl
installed. If not let me know.
Try running the following command from your terminal, filling in the appropriate information where possible.
curl https://api.twilio.com/2010-04-01/Accounts/[Your AccountSid]/Messages\?DateSent\=2013-10-20&PageSize\=5 -u [YourAccountSid]:[YourAuthToken]
Running the curl command, the urls all look like below:
nextpageuri="/2010-04-01/Accounts/[AccountSid]/Messages.json?DateSent=2013-10-20+00%3A00%3A00%2B00%3A00&PageSize=5&Page=1&AfterSid=SM0d9265223abe12e53db909896e788daf"
I received a new report of this issue.
Reviewing the Twilio API response, it seems the next_page_uri format has changed in the Messages resource vs SMS/Messages. I will also file an internal API issue.
Hi everyone,
I figured I should send a follow up to that. (I reported the issue to Brian) My code snippet to recreate looks like this:
the_first = Date.today.at_beginning_of_month.strftime("%Y-%m-%d")
messages = @twilio.account.messages.list("DateSent>" => the_first)
begin
messages = messages.next_page
end while not messages.empty?
But if I change that to @twilio.account.sms.messages.list
it works correctly.
Thank you for the update.
This is a server-side API issue, if this problem persists, please contact Twilio Support.
This issue is no longer a problem as I rewrote our app to respond to the sms_url.
Jeremy
Sent from my iPhone
On Jul 25, 2014, at 7:27 PM, Carlos Diaz-Padron notifications@github.com wrote:
This is a server-side API issue, if this problem persists, please contact Twilio Support.
— Reply to this email directly or view it on GitHub.
I'm converting from the old
account.sms.messages
logic toaccount.messages
. I'm getting an "Invalid value for DateSent" message.Steps to reproduce:
results = @client.account.messages.list(:date_sent => 24.hours.ago.strftime("%Y-%m-%d"), :page_size => 5) results.next_page
=> Twilio::REST::RequestError: Invalid value for DateSent