Pagination
The API supports pagination to efficiently handle large data sets for speed and performance. Pagination allows you to retrieve data in smaller chunks or "pages" rather than returning all records at once. The maximum number of records that can be returned per page is 100. You can specify the number of records per page and the page number in your API request using the pagesize and page query parameters.
Usage
When making an API request, you can include the pagesize and page query parameters to control the pagination.
-
pagesize: The number of records to return per page. The default pagesize is 10 and the maximum is 100.
Note: If the requested pagesize is more than 100, then the totalitem count is returned, which can then be used to determine the number of pages.
-
page: The page number to retrieve, starting from 1.
Request Information
URL
api/entity/IIncidentRequest?pagesize=15&page=2
Method
GET
Header Parameters
Parameter |
Description |
Type |
Example |
sessionid |
The encrypted session ID. |
string |
EhbNKWgPZNJn== |
Body Parameters
The body contains a JSON representation of the item's fields and the new values of those fields. In the following sample, the request retrieves the second page of Incident Request records with a limit of 15 records per page.
Sample Request
URL: https://localhost/cgrestapi/api/entity/IIncidentRequest?pagesize=15&page=2
Header: sessionid: EhbNKWgPZNJnHRPWJ3PfvLrtavbL591sfEVzR3Hn/Fs7RCBceNxpWIuhw0iIn8YM
Response Information
The API response will include the paginated data along with additional metadata about the pagination.
Sample Response Snippet
{
"ID": 29,
"IncidentRequestTasks_link": "api/entity/IIncidentRequest/29/IncidentRequestTasks",
"DueDate": "2023-04-25T11:39:58Z",
"ItemID": "IR-0000029",
"AssignedTo": 67,
"Requester": 65,
"RequesterName": "Tom Bryant",
"Summary": "Needs newest Microsoft office installed on demo laptop",
"VIP": false,
"Status": "New",
"LastModifiedByName": "",
"LastAccessedByName": "",
"eTag": 5,
}