Hopp til hovedinnhold

Visma net API
Paging explained

About Paging

When getting lists of data from APl-endpoints it will be most efficient for both the client and server to divide the result into portions instead of getting all the data returned at once. The Visma.net API supports this by implementing a method called paging. Paging means that when you request lists of data you should also provide two extra query-parameters called pageSize and pageNumber.

pageSize: The maximum number of records you want to have returned on each page (the length of each page)

pageNumber: The page you are requesting.

Example: In the database you have 350 customers, you make a GET request to the Customer-endpoint to get all these. To limit the number of customers received you can divide this into pages that contain upto 100 customer (pageSize=100). To get the complete list you then have to make 4 requests to the Customer-endpoint:

About Paging

Example: In the database you have 350 customers, you make a GET request to the Customer-endpoint to get all these. To limit the number of customers received you can divide this into pages that contain upto 100 customer (pageSize=100). To get the complete list you then have to make 4 requests to the Customer-endpoint:

"metadata":{ 
"totalCount" : 450 ,
"maxPageSize" : 10
}