Invalid value for DateSent when using next_page #71

jeremygpeterson opened this Issue Oct 21, 2013 · 9 comments


None yet
5 participants

I'm converting from the old account.sms.messages logic to account.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)

=> Twilio::REST::RequestError: Invalid value for DateSent


dougblack commented Oct 21, 2013

@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
  • ruby
    are you using?

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".


dougblack commented Oct 21, 2013

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[Your AccountSid]/Messages\?DateSent\=2013-10-20&PageSize\=5 -u [YourAccountSid]:[YourAuthToken]

Running the curl command, the urls all look like below:


Beans0063 commented Nov 12, 2013

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.

calh commented Nov 12, 2013

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 ="%Y-%m-%d")
    messages = @twilio.account.messages.list("DateSent>" => the_first)
      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.


carlosdp commented Jul 26, 2014

This is a server-side API issue, if this problem persists, please contact Twilio Support.

@carlosdp carlosdp closed this Jul 26, 2014

This issue is no longer a problem as I rewrote our app to respond to the sms_url.


Sent from my iPhone

On Jul 25, 2014, at 7:27 PM, Carlos Diaz-Padron 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.

ajtack pushed a commit to ajtack/twilio-ruby that referenced this issue Apr 28, 2017

Merge pull request #71 from looselycoupledlabs/master
Remove C# helper library from REST call example
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment