How to Paginate

Several Bonusly API endpoints support pagination.

/bonuses (Index) - :limit, :skip

/users (Index) - :limit, :skip

/users/:id/redemptions (Index) - :limit, :skip

The two components of pagination are the number of items per page, controlled by limit, and the page number, controlled by skip.

For example, to get a list of bonuses 10 items long, the correct API call would include the params limit=10. To get the 5th page of this list, you would include the params skip=40 - the calculation being 4x10 - you are skipping the first 4 pages at a page size of 10.

Example: https://bonus.ly/api/v1/bonuses?limit=10&skip=40&access_token=API-KEY

For limit, the mininum value is 1, the default value is 20, and the maximum value is 100 (or 500 in the case of bonuses).

For skip, the minimum value is 0.

Entering values outside of these maximum and minimums will return a 400 'out of range' error.

Endpoints which support pagination return the X-Total-Count header. This is the total number of items in the collection.