Paging

Breaking queries into multiple pages.

Paging is the process of breaking up the query set returned from the API call into pages of one or more records. Multiple pages of data will need to be combined on the client side to produce the full data set.

For both raw APIs and _query APIs (as well as most of the other non-raw or _query APIs), paging is achieved with the use of 2 parameters, limit and offset.

Limit is the number of records returned in the single call. While offset is the number of records to skip. The offset value is usually equal to the pagenumber * _limit.

For example, an initial call for the 1st page of data might be this:

https://my_workspace.api.vitruvi.cc/api/v1/raw/core/customfieldvalue?limit=10000&offset=0

And to get page 5, the call would become:

https://my_workspace.api.vitruvi.cc/api/v1/raw/core/customfieldvalue?limit=10000&offset=50000

There are no set rules of thumb when determining the limit for a particular endpoint. This really depends on the number of fields that get returned for each record and therefore the expected size of the total payload for each page of data. For "tall" data sets which only have a few fields but lots of records, this is likely around 10,000. For wide data sets with a lot of columns, this may be closer to 1000 or even as low as 500.

It is best to refer to the 1 to 3 second rule when testing the API calls to determine whether the limit should be increased or decreased.