[#100] getBookings doesn't respect date filter

Migrated from Redmine #100 | Author: Ara Howard
Status: Resolved | Priority: High, I’m very impatient | Created: 2018-01-31


according to docs at API documentation | SimplyBook.me Online Scheduling and ticket #97 a ‘date_from’ filter can be used to limit those bookings returned. however, we’re not seeing this work via the admin api

this post, which does not limit by date

https://cl.ly/pBem/Image%202018-01-31%20at%2012.31.25%20PM.png

returns exactly the same bookings as this post, which does

https://cl.ly/pDXB/Image%202018-01-31%20at%2012.36.08%20PM.png

i’m attaching two files, a.json (the result of the 1st request w/o a date_from filter) and b.json (the same result with a date_from filter) - note that these are exactly the same.

the api doesn’t return any errors, obviously, but also doesn’t seem to limit via date_from

Dmytro Bondarev wrote:

Please pass values properly. instead of [[{…}]] pass [{…}]

Ara Howard wrote:

hrm. the issue, i found, was that passing params: fails. for the ‘empty’ query one must pass params[{}] (empty object literal) or else the call fails with ‘params is not an array’ - even tho it is:

confusing since:

  • the docs say “pass an object”
  • passing an object doesn’t work
  • passing an empty array doesn’t work
  • passing an array with an empty object works
  • passing an array with a non empty object works

see this:

https://cl.ly/pCZM/Image%202018-01-31%20at%203.38.05%20PM.png

Dmytro Bondarev wrote:

pass the object to JSON RPC client.
In case you are using custom JSON RPC client please follow JSON-RPC 2.0 Specification with non named parameters.