Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Adding in the <= and >= to the query string for date ranges #22

wants to merge 1 commit into


None yet
2 participants

cbarton commented Apr 5, 2012

Currently there is no way to send a query string like DateSent<=YYY-MM-DD as noted in the API, specifically for getting SMS messages. (http://www.twilio.com/docs/api/rest/sms) This fixes that.


andrewmbenton commented Apr 9, 2012

Thanks for catching this. I had completely forgotten about the inequality magic that the API allows.

My only concern is that this ends up cgi-escaping the '>=' or '<=' and I'm not sure how that will behave when received by the API. Also setting up a regex seems unnecessary to just check for a trailing '>=' or '<=', but maybe it's faster?


andrewmbenton commented Apr 9, 2012

In fact, now that I think about it, doesn't the current library "just work" if you pass something like:

@sms.list :'DateSent<' => '2012-04-09'

cbarton commented Apr 9, 2012

Thanks for the review of this request, your last point is valid although I added the functionality for clarity's sake. The encoding of the query string should be handled correctly (my testing shows so). And it is a little faster since we are only performing one loop + a compiled regex (however the speed increase is minimal in this case). Up to your style guide to accept or close, either way thanks for the consideration.



andrewmbenton commented Apr 21, 2012

I think I'd rather not add code to clarify something that does currently work, even if the usage of <= and >= is a little clunky/unclear.

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

@mcelicalderon mcelicalderon Merge pull request #22 from TwilioDevEd/add-twiml-voice-snippets
Add voice queue TwiML snippets
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment