URL Paging
The URL pager is used when URL parameters indicate the page to be returned.
A response is considered to be complete if the last page if it is empty.
URL Paging has four properties to control its operation. This allows you to integrate with services which have implemented URL Paging differently.
- Paging Start At
- Specifies the number at which paging starts at. Typically this is 1, to denote the first page or record.
- Paging Path/Parameter Name
- This is the parameter name used in the URL.
- Paging Increment By
- This property specifies how much the paging parameter will be incremented by on each requested page.
- Paging Increment/Parameter Name
- When this property has a value, this allows you to also specify a page size (or to specify a number of records to return) in the URL sent to the service. The value of the parameter is the 'Paging Increment By'.
Specify ONLY Page & Page Start Parameters (Default Page Size)
Setting a page parameter tells the web-service which page of data to return. Often these can be combined with setting a page size parameter.ome services have a predefined or default page size. For example, a service with a default page size of 50, page one would return the first 50 records, page two would return records 51-100 and so on.
Resultant URLs
First request http://pagedservice.com/api?page=1
Second request http://pagedservice.com/api?page=2
Specify Page and Page Size
When specifying a page parameter, you can also set the page size. This is achieved by specifying a fixed parameter within the Base URL.
For example, setting a page size of 100, page one would return the first 100 records. Page two would return records 101-200.
Resultant URLs
First request http://pagedservice.com/api?pagesize=100&page=1
Second request http://pagedservice.com/api?pagesize=100&page=2
Specify Page Size and Page Offset
Another common method of paging via URL is to specify an offset, the offset in this case is the start parameter. This mode is used when the service requires you to specify a record number offset, as opposed to a page (and accompanying page size).
For example, if a service were queried using a 50 record offset the first page would return records 1-50, the second would return 51-100, and so on.
Resultant URLs
First request http://pagedservice.com/ap?start=1&size=50
Second request http://pagedservice.com/ap?start=51&size=50