Pagination
Overview
The Violet APIs provide you with access to immense amounts of data. Through pagination, you can easily navigate through this data using the page and size query parameters.
Requests
Query Parameters:
page - The starting position for which this API should return data
size - Limit to the number of items returned by this request. Default value of 20 if field not set.
Response
Responses for calls that support pagination include additional information designed to let you quickly navigate through our datasets. The following information is returned:
content - Content you are requesting from the call
pageable - Custom object that stores information about details for the current page, such as page number, sort, etc.
total elements - Total number of elements matching query criteria
last - Boolean denoting whether or not this is the last page
total pages - Total number of pages based on size input from query parameter
sort - Sorting details for ordering returned in content
number of elements - Number of elements present in current page
first - Boolean denoting whether or not this is the first page
size - Input size from query parameter
number - TBD
empty - Boolean denoting whether or not content is present
As seen above, Violet uses page and total_elements in the response object to give you details on the total number of elements present in our datasets matching your criteria as well as the number of total pages you need to go through for all data. You can pass these page numbers through the request query parameters to fetch the next set of data.
Since Violet uses more than next and previous cursors to let you traverse through the dataset, you can even use page numbers and size to make parallel calls to our system to retrieve information as quickly as you need to for your application.