Paging

When making calls to the Limecraft Flow API, the response may contain a large number of results. To make responses more manageable, we’ve implemented pagination.

By default, the API limits the number of results returned, but we recommend that you always explicitly set the limit parameter to ensure you know how many results per page you’ll get. This is important because relying on the default value can produce unexpected results if you’re expanding different parts of the response.

Limit

To illustrate, let’s say you need to request all collections in a production, but you only want to receive 5 results at a time. In this case, you should set the limit query parameter to 5, as shown in the following example:

/api/production/12345/eo?limit=5

Offset

Once you’ve loaded the first n results, you might be interested in retrieving the next n results as well. You can achieve this by setting the offset parameter, as shown in the following example:

/api/production/12345/eo?limit=5&offset=5

Pagination Headers

To help you navigate through the pages of results, the server provides two headers:

  • X-Pagination-Total-Results: the total number of expected results.

  • X-Pagination-Offset: the current offset of the results, which should be equal to the offset parameter provided in the call.