[#877] REST API - Length array of returned data is always 10

Migrated from Redmine #877 | Author: Jan-Pieter Wintmolders
Status: Feedback | Priority: High, I’m very impatient | Created: 2022-05-02


Hello we are using the REST API to get booking information.
But the returned data is always an array of 10. Even when I can see that to counted items are more. Can you see what is causing this issue?

I do following fetch in JS with a date filter:
fetch(https://user-api-v2.simplybook.me/admin/bookings?filter[date]=${date.value}

And following data is coming back:
(the counted items is 16 which is correct, but the array is 10 and should be also 16 in this case)

{data: Array(10), metadata: {…}}
data: Array(10)
0: {provider: {…}, service: {…}, client: {…}, status: ‘confirmed’, membership_id: null, …}
1: {provider: {…}, service: {…}, client: {…}, status: ‘confirmed’, membership_id: null, …}
2: {provider: {…}, service: {…}, client: {…}, status: ‘confirmed’, membership_id: null, …}
3: {provider: {…}, service: {…}, client: {…}, status: ‘confirmed’, membership_id: null, …}
4: {provider: {…}, service: {…}, client: {…}, status: ‘confirmed’, membership_id: null, …}
5: {provider: {…}, service: {…}, client: {…}, status: ‘confirmed’, membership_id: null, …}
6: {provider: {…}, service: {…}, client: {…}, status: ‘confirmed’, membership_id: null, …}
7: {provider: {…}, service: {…}, client: {…}, status: ‘confirmed’, membership_id: null, …}
8: {provider: {…}, service: {…}, client: {…}, status: ‘confirmed’, membership_id: null, …}
9: {provider: {…}, service: {…}, client: {…}, status: ‘confirmed’, membership_id: null, …}
length: 10
[[Prototype]]: Array(0)
metadata:
items_count: 16
on_page: 10
page: 1
pages_count: 2
[[Prototype]]: Object
[[Prototype]]: Object

Dmytro Bondarev wrote:

Hi,

You can pass on_page=X or go page by page to get all bookings.