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 |
limit=limitValue | Returns a set of |
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:
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: