[#807] Question on filtering bookings

Migrated from Redmine #807 | Author: zelim han
Status: Feedback | Priority: High, I’m very impatient | Created: 2021-10-22


Hi,

When we are getting upcoming data to our system with API we are using below request:

https://user-api-v2.simplybook.me/admin/bookings?filter[upcoming_only]=1

This request only returns 10 booking records. When I change request as:

https://user-api-v2.simplybook.me/admin/bookings?filter[upcoming_only]=1&on_page=20

It returns 20 record.

My question is how can I get all upcoming records without any limit of record number?

Dmytro Bondarev wrote:

Hi,

You should call it page by page.
in response you will se the total number of pages.

zelim han wrote:

I am a bit confused on this.

When I try this:

https://user-api-v2.simplybook.me/admin/bookings?filter[upcoming_only]=1&page=1

I get all records in first page. What I need is all upcoming records in all pages. So how should I make the request?

Dmytro Bondarev wrote:

Call another request with page=2 , then page=3 , etc, page by page.