SAP Knowledge Base Article - Public

3308165 - How to use "snapshot" pagination to query an OData entity using REST tool - POSTMAN?

Symptom

Snapshot-based pagination is a server-side pagination that works by keeping a list of all business keys of the data set on the server. For non-MDF based entities, you can enable snapshot-based pagination by adding parameter &paging=snapshot in a query.

Pagination limits the maximum size of a query response to 1,000 records. The OData standard provides a '__next' link in your query response if there are more results in the database.

Enable session reuse to reduce the number of sessions and optimize the performance of API calls.

Image/data in this KBA is from SAP internal systems, sample data, or demo systems. Any resemblance to real data is purely coincidental.

Environment

SAP SuccessFactors HXM Suite

* OData API

Resolution

Use paging=snapshot parameter in the GET query.

The first successful login returns a header, Set-Cookie and a CSRF token named X-CSRF-Token.

Store the value of the cookie and CSRF token in the authorization header as a HTTP Cookie (header field names, Cookie and X-CSRF-Token) and use them in subsequent requests to reuse the session.

Notice the __next parameter at the end of each query response that contains a $skiptoken value indicating the next page of data.

Now execute the API call in the _next parameter of the first page API response

Cookie and X-CSRF-Token values remain same.

Notice again _next parameter at the end of the second page API response.

However, $skiptoken value generated in second page response will be different from the $skiptoken value generated in first page response.

There is no _next parameter at the end of third page response which means there are no more records to be fetched from database. It’s the last page API response.

See Also

Snapshot-Based Pagination

Enabling Session Reuse

Keywords

pagination, snapshot, session reuse, reuse, session, _next, OData, API, non-MDF, cookie, csrf, token , KBA , LOD-SF-INT-ODATA , OData API Framework , How To

Product

SAP SuccessFactors HXM Suite 2211