OData API returns a certain amount of records in the response when more are expected (2024)

Symptom

You performed an OData API query and it fetched a certain amount of records, but you were expecting more results in the response payload.

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

Environment

Cause

The API has a limit in the amount of records to be returned in the API response. When that limit is exceeded, it uses a mechanism called Pagination,which will make the response return the exceeding records in a subsequent page.

Resolution

By default, the max records returned in the response of OData API is 1000 per page.You are able to change that using theCustom Page Sizeparameter. If you perform an API query that exceeds the Page Size number, then the API will create more pages of results.

If you were expecting a specific record to be returned and it didn't return in the first page of the response, this may indicate that the record is actually in some other page of the response.

To get access to the subsequent pages and see the next set of records, you'll have to perform some actions that depend on the Pagination method being used:

For Client-Side Pagination

Refer to the KBA2675265 - OData API: Using the $top and $skip parameters for pagination (Client-Side Pagination).

For Server-Side Pagination

Refer to Server-Side Pagination. When using this method, you need to use the Skiptoken which is located at the bottom of the response payload. It is a link similar to these ones below:

  1. On XML format:
    <link rel="next" href="https://apisalesdemo4.successfactors.com:443/odata/v2/User?$select=userId,status%20%20%20&amp;$skiptoken=eyJzdGFydFJvdyI6MTAwMCwiZW5kUm93IjoyMDAwfQ=="></link>
  2. On JSON format:

    "__next":"https://apisalesdemo4.successfactors.com:443/odata/v2/User?$select=userId,status&$format=json&$skiptoken=eyJzdGFydFJvdyI6MTAwMCwiZW5kUm93IjoyMDAwfQ=="

If you use the URL contained within the "__next" field, it will take you to the next page of records.

See Also

Keywords

1000, missing, sf, skip token, __next, next, pages, page, pagination, page size, pagesize, top, skip, $top, $skip, client-side, server-side, client side, server side, , KBA , LOD-SF-INT-ODATA , OData API Framework , Problem

Product

SAP SuccessFactors HXM Suite all versions

OData API returns a certain amount of records in the response when more are expected (2024)
Top Articles
Latest Posts
Article information

Author: Kelle Weber

Last Updated:

Views: 5954

Rating: 4.2 / 5 (73 voted)

Reviews: 88% of readers found this page helpful

Author information

Name: Kelle Weber

Birthday: 2000-08-05

Address: 6796 Juan Square, Markfort, MN 58988

Phone: +8215934114615

Job: Hospitality Director

Hobby: tabletop games, Foreign language learning, Leather crafting, Horseback riding, Swimming, Knapping, Handball

Introduction: My name is Kelle Weber, I am a magnificent, enchanting, fair, joyous, light, determined, joyous person who loves writing and wants to share my knowledge and understanding with you.