Pagination
Pagination is used for fetching list response in batches to reduce response overhead and to render data in pages.
Row Count
Row Count determines the number of rows of data to be rendered per page. It is
represented as n
records.
row_count
- determines number of objects to be provided in list response.
Request Parameters
Key | Value |
---|---|
input_data | { “list_info” : { “row_count” : 3 } } |
The above example gets first 3 records from get list.
Note
The default value for row_count
is 10.
Start Index
Start Index is used to mention the index from which the data records needs to be fetched.
start_index
- start index to get records.
Request Parameters
Key | Value |
---|---|
input_data | { “list_info” : { “row_count” : 3, “start_index” : 1 } } |
The above example gets 3 records starting from index 1.
Note
The default value for start_index
is 1.
Response Parameters
{
"response_status": [
{
"status_code": 2000,
"status": "success"
}
],
"list_info": {
"has_more_rows": false,
"start_index": 1,
"row_count": 3
},
"requests": [
{...},
{...},
{...},
]
}
How to get next N records?
The next n
records can be fetched by requesting records with
updated start_index
as start_index + row_count
index.
start_index (new) = start_index (previous) + row_count
= 3 + 1 = 4
Request Parameters
Key | Value |
---|---|
input_data | { “list_info” : { “row_count” : 3, “start_index” : 4 } } |
Response Parameters
{
"response_status": [
{
"status_code": 2000,
"status": "success"
}
],
"list_info": {
"has_more_rows": false,
"start_index": 4,
"row_count": 3
},
"requests": [
{...},
{...},
{...},
]
}