Paginering

To limit the load on our APIs, we have chosen to “force” pagination. The reason for this is that we developers should have a knowledge with the data we retrieve and do it in the least burdensome way for our APIs and perhaps give an extra thought to what we want to achieve with the integration we create.

Server-side pagination with @odata.nextLink

In the APIs for Prosjekt, Timelinje, Planlegging and Element we have added @odata.nextLink and a page size of 1000. If you want to get the first 5000 results, you put in top=5000. In the result, you will receive a first page with the first 1000 results in addition to a link called @odata.nextLink. This link is generated to give the next 1000 results. This continues until the last page where there will not be an @odata.nextLink. With @odata.nextLink, there is basically no need for top, but we have chosen to require this in addition. Note that if top is equal to or lower than the page size of 1000, you will not receive an @odata.nextLink.

Client-side pagination

There is always the possibility to handle pagination yourself using top and skip. But remember that we have set a maximum page size of 1000 which means that you will not get more, even if you have a top that says a higher number. Then we, as mentioned server-side pagination intervene and add an @odata.nextLink.

Resources

Here are some resources that explain @odata.nextLink and pagination a bit more: 
https://www.youtube.com/watch?v=DB_NoC9a1JI 
https://learn.microsoft.com/en-us/graph/paging?tabs=http