Aras Innovator Platform

Paging

Use the offset and fetch AML attributes to configure Server-driven paging. When the client specifies the odata.maxpagesize value in the Prefer request header, the OData Interface translates the value using a combination of the offset and fetch attributes while taking into account any $skip and $top options specified in the request. The @odata.nextLink annotation value includes a $skiptoken option which specifies the starting position of the next page within a requested data set. All query options from the original request appear in the @odata.nextLink URL.

The last page cannot contain the @odata.nextLink annotation. In order to determine whether @odata.nextLink must be present in the response, the translator produces AML that requests one additional item. If all requested items are received, @odata.nextLink must be included in the response. If the number of returned items is less than requested, @odata.nextLink must be omitted.

GET http://host/server/odata/Part?$skip=3&$top=30

Prefer: odata.maxpagesize=10

Response:

{

"@odata.context": “http://host/server/odata/$metadata#Part”,

"@odata.nextLink": “http://host/server/odata/Part?$skip=3&$top=30&$skiptoken=10",

“value": [

{ “id": "…", “item_number": “P-01", … remainig Part item properties },

… 9 remaining Part items

]

}

The request for the next page is translated as follows:

GET http://host/server/odata/Part?$skip=3&$top=30&$skiptoken=10

Prefer: odata.maxpagesize=10

Response:

{

"@odata.context": “http://host/server/odata/$metadata#Part”,

"@odata.nextLink": “http://host/server/odata/Part?$skip=3&$top=30&$skiptoken=20",

“value": [

{ “id": "…", “item_number": “P-10", … remaining Part item properties },

… 9 remaining Part items

]

}