Development documentation Help

Pagination

This chapter describes how pagination works in the KMI LMS REST API.

All methods that return collections of entities limit to the number of returned entities by default. If you do not specify explicitly the number of entities in limit parameter, the server returns a part of the collection.

For most resources, the server returns a maximum 100 elements by default. You need to use pagination to retrieve the entire collection.

Pagination with offset and limit parameters

LMS API returns only the first 100 entities be default. It protects the server from overload. You need to use offset and limit parameters to retrieve the complete list of entities.

Parameter

Description

offset=offsetValue

Let you read entities starting from offsetValue.

limit=limitValue

Returns a set of limitValue entities from offsetValue position.

Using these two parameters, you can iterate through the entire collection of entities. For example, you can iterate through the entire collection of 250 entities:

Request URL:

https://lms.example.com/api/v2/users/?offset=0&limit=100 https://lms.example.com/api/v2/users/?offset=100&limit=100 https://lms.example.com/api/v2/users/?offset=200&limit=100

Additional limits

For very large collections, requesting all the data can be resource and time-consuming. To minimize amount of data, you can specify additional parameters to request only data that changed since the previous call using updatedAfter parameter. Combining updatedAfter with pagination parameters - offset and limit - can significantly improve the application performance.

Example

Request URL:

https://lms.example.com/api/v2/users/?offset=0&limit=100&updatedAfter=2024-03-24T14%3A58%3A41Z
Last modified: 06 January 2025