Invalid value for DateSent when using next_page #71

Closed
jeremygpeterson opened this Issue Oct 21, 2013 · 9 comments

Comments

Projects
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)
results.next_page

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

Contributor

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

Contributor

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

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

Contributor

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.

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.

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