Pagination schemes for REST API responses


Several endpoints have the potential to return large amounts of data in their responses. These endpoints follow a standard approach for returning paginated results. For example, a search for all Hosts in the system could find more than the default page limit of 100 results. In this case the endpoint returns the first 100 results, and additional fields that provide links to the next page:

http://<local hots>:<port number>/api/arsys/v1.0/entry/<form name>/?offset=0&limit=4
{  
"entries": [      
{          
"values": {              
"Request ID": "000000000000001",               
"Character Field": "Test",              
"Submitter": "Demo",               
"Drop-Down List Field": "Fruit",               
"Create Date": "2019-01-28T11:19:29.000+0000",              
"Radio Button Field__c": null,              
"Assigned To": null,               
"Last Modified By": "Demo",               
"Modified Date": "2019-01-28T11:20:16.000+0000",               
"Status": "Closed",               
"Short Description": "Demo",               
"Status History": {                   
"New": {                       
"user": "Demo",                       
"timestamp": "2019-01-28T11:19:29.000+0000"
                  },                  
"Closed": {                       
"user": "Demo",                      
"timestamp": "2019-01-28T11:19:50.000+0000"                   
}               
}           
},           
"_links": {               
"self": [                   
{                       
"href": "http://<Local host>:<port number>/api/arsys/v1.0/entry/<form name>/000000000000001"                   
}               
]          
}      
},      
{          
"values": {               
"Request ID": "000000000000002",              
"Character Field": "R1",              
"Submitter": "Demo",              
"Drop-Down List Field": "Veg",               
"Create Date": "2019-01-29T06:17:46.000+0000",              
"Radio Button Field__c": "March",               
"Assigned To": null,               
"Last Modified By": "Demo",               
"Modified Date": "2019-01-29T06:17:46.000+0000",               
"Status": "New",              
"Short Description": "Demo",
              "StatusHistory": {                   
"New": {                      
"user": "Demo",                       
"timestamp": "2019-01-29T06:17:46.000+0000"                   
}               
}           
},           
"_links": {    
          "self":
[                  
{                      
"href": "http://<Local host>:<Port number>/api/arsys/v1.0/entry/<Form name>/000000000000002"                   
}               
]           
}      
},       
{          
"values": {       
      "Request ID":000000000000003",               
"Character Field": "R2",              
"Submitter": "Demo",               
"Drop-Down List Field": "Egg",               
"Create Date": "2019-01-29T06:18:34.000+0000",               
"Radio Button Field__c": "March",              
"Assigned To": null,               
"Last Modified By": "Demo",               
"Modified Date": "2019-01-29T06:18:34.000+0000",               
"Status": "New",               
"Short Description": "Demo",              
"Status History": {                   
"New": {                       
"user": "Demo",                       
"timestamp": "2019-01-29T06:18:34.000+0000"                   
}               
}           
},         
 "_links": {               
"self": [                   
{                       
"href": "http://<Local host>:<port number>/api/arsys/v1.0/entry/<Form Name>/000000000000003"                   
}              
]           
}      
},      
{           
"values": {               
"Request ID": "000000000000004",              
"Character Field": "R4",              
"Submitter": "Demo",              
"Drop-Down List Field": "Milk",               
"Create Date": "2019-01-29T06:18:47.000+0000",               
"Radio Button Field__c": "March",              
"Assigned To": null,               
"Last Modified By": "Demo",               
"Modified Date": "2019-01-29T06:18:47.000+0000",               
"Status": "New",               
"Short Description": "SD4",               
"Status History": {                  
"New": {                      
"user": "Demo",                       
"timestamp": "2019-01-29T06:18:47.000+0000"                   
}               
}          
},          
"_links": {              
"self": [                   
{                      
"href": "http://<Local host>:<Port number>/api/arsys/v1.0/entry/<form name>/000000000000004"                  
}               
]          
}      
}   
],   
"_links": {  
    "next": [           
{               
"href": "http://<Local host>:<Port number>/api/arsys/v1.0/entry/<Form Name>/?offset=4&limit=4"          
}       
],       
"self": [           
{               
"href": "http://<Local host>:<port number>/api/arsys/v1.0/entry/<form name>/?offset=0&limit=4"           
}       
]  
}
}

Here, the value of the "offsetfield is the starting index of the first item in this page of results. The "limitfield defines the number of Instances to be retrieved.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*