By default, the Data360 Govern APIs will return the first 200 records. Subsequent records can be called by introducing a page number into the API call or overriding the number of records to return.
For general information about the APIs, please see our API Documentation.
Page Size
The default page size is 200 and can be increased by appending ?_pageSize=####
to the end of the API URL, where ####
is your new page size.
For example, ?_pageSize=2000
will set your page size to 2,000 items.
The largest page size you can specify is 200,000. The API will return an error if you specify a larger value.
Page Number
The default page number is 1 and can be overridden by appending ?_pageNum=#
to the end of the API URL, where ####
is your new page size.
For example, ?_pageNum=2
will return the second page of items.
Each page will contain 200 items by default, or the number of items specified in the pageSize variable.
Using Page Size and Page Number variables together
Multiple variables are concatenated by an &
, for example: ?_pageSize=300&_pageNum=2
Dynamically determining the number of pages
When making an API call, the number of total items will be returned, in addition to the first set of items:
{
"items": [ ... ],
"pageSize": 300,
"pageNum": 1,
"total": 1171
}
By taking the total items returned divided by page size and rounding up to the nearest integer, you can dynamically determine how many pages to loop through. For the example above, there will be four pages in total, and the first page is already returned within the items variable. This means there are three additional page to loop through.
Comments
0 comments
Please sign in to leave a comment.