skip to main content
Input REST file syntax : Table definition entries : Paging
  

Try DataDirect Drivers Now

Paging

The connector supports the following paging mechanisms:
*Row offset paging
*Page number paging
*Next page token
To configure paging, specify values for the following properties that correspond to the mechanism you want to employ. These properties can be specified at either the top level of the REST file, as an entry, or as a property in the body of a table definition. Properties set at the top level define the default behavior for all the tables defined in the file, while properties specified in a table definition override paging behavior for that table. If paging properties are not specified, the driver attempts to retrieve the first page for data sources that require paging.
In addition, for data sources that support more complicated parameters, you can specify parameters using a template. See "Using templates for paging parameters" for details.
The following demonstrates the syntax used to configuring row offset paging in the body of a table definition:
"<table_name>": {
"#path": "<host_name>/<endpoint_path>",
"#firstRowNumber":1,
"#maximumPageSize":1000,
"#pageSizeParameter":"maxResults",
"#rowOffsetParameter":"startAt"
},

General paging parameters

The following table describes optional parameters that can be used by all paging mechanism types:
Table 16. General Paging Properties
Property
Description
#fieldListParameter
Specifies the name of the URI parameter that contains the comma separated list of fields to be issued in a request. For example, if you were to issue the following query with #fieldListParameter=fields:
SELECT * FROM ORDERS
The following request would be issued for an entry containing id and success fields:
https://www.example.com/ORDERS?fields=id%2Csuccess
#hasMoreElement
Specifies the element in the response that denotes there is another page. The service indicates there are no additional pages by omitting the element from the response or returning a value of false. For elements not stored at the top level, this value should include a slash-separated path.
#maximumPageSize
Specifies the maximum page size in rows.
#pageSizeElement
Specifies the name of the element containing the page size in rows that must be passed in the URI to get the next page. For elements not stored at the top level, this value should include a slash-separated path.
#totalPagesElement
Specifies the name of the element in the response that contains the total number of pages contained in the result set. For elements not stored at the top level, this value should include a slash-separated path.
#totalRowsElement
Specifies the name of the element in the response that contains the total number of pages contained in the result set. For elements not stored at the top level, this value should include a slash-separated path.

Row offset paging

The following table describes the parameters that are specific to configuring row offset paging:
Table 17. Row Offset Paging Properties
Property
Description
#firstRowNumber
Specifies the number of the first row. The default is 0; however, some systems begin numbering rows at 1.
#pageSizeParameter
Specifies the name of the URI parameter that contains the page size.
#rowOffsetParameter
Specifies the name of the URI parameter that contains the starting row number for this set of rows.

Page number paging

The following table describes the parameters used to configure page number paging:
Table 18. Page Number Paging Properties
Property
Description
#firstPageNumber
Specifies the number of the first page. The default is 0; however, some systems begin numbering pages at 1.
#pageSizeParameter
Specifies the name of the URI parameter that contains the page size.
#pageNumberParameter
When requesting a page of rows, this is the name of the URI parameter to contain the page number.

Next page token paging

The following table describes the parameters used to configure next page token paging:
Table 19. Page Number Paging Properties
Property
Description
#nextPageElement
Specifies the name of the element containing the token that must be passed in the URI to get the next page. For elements not stored at the top level, this value should include a slash-separated path.
#nextPageParameter
Specifies the name of the URI parameter that holds the token used to fetch the next page. This is the token found on the current page at the location specified by the #NextPageElement.
#pageSizeParameter
Specifies the name of the URI parameter that contains the page size.
* Using templates for paging parameters