cancel
Showing results for 
Search instead for 
Did you mean: 

SF LMS ODATA API 'Students' not returning more than 10 records in response

sinhasouvik
Participant
0 Kudos

Hi Experts,

I was trying to fetch the Users/Students/Learners records using below LMS ODATA API using some filter criteria mentioned below. But not able get more than 10 records in API response. Also I did not find any filter criteria like $top to fetch more than 10 records for this Student search API.

Could you please let me know whether this is the standard behavior or there is any way to fetch more than 10 records from this API call.

/learning/odatav4/searchStudent/v1/Students?$filter=criteria/isActive eq true and criteria/domainIDs eq 'XXXX'

I was following the below help docuemnts:

API details:- https://help.sap.com/viewer/5aab9bef78fc4c4fa199c1f7aa142720/2005/en-US/06a0bc063f314e139252a844e0c5...

Use case sample:- https://help.sap.com/viewer/5aab9bef78fc4c4fa199c1f7aa142720/2005/en-US/b13684d05fe84842aaaa71f75766...

Regards,

Souvik

Accepted Solutions (1)

Accepted Solutions (1)

sinhasouvik
Participant

To overcome the above limitation/features of Odata v4, you can use the OData standard parameter $top and $skip for this:

{{lmsDomain}}learning/odatav4/searchStudent/v1/Students?$top=200&$skip=10

This will get you 200 records and will skip the first 10.

Example including filter:-

learning/odatav4/searchStudent/v1/Students?$top=200&$skip=10&$filter=criteria/isActive%20eq%20true

See also OData V4 spec here: OData Version 4.0 Part 1: Protocol (oasis-open.org)

Please not that the spec is not always updated by vendors by 100% some feature might be available some not.

Regards,

Souvik

Answers (1)

Answers (1)

manojramesh47
Explorer
0 Kudos

Hi souvik_sinha ,

Is there any chance to get all the active users details at once using API from LMS.

for example lets say 1800 users should be called without missing anyone?

is there any possibility?

Regards,
Manoj.

sinhasouvik
Participant
0 Kudos

Hello Manoj,

As per my expertise, it will not.

SF LMS API's works on ODATA V4, these API's are all microservice.

API Limits in Learning

API limits protect SAP SuccessFactors Learning services from overload.

We protect your services from purposeful or accidental overload by setting limits on:
  • The volume of data sent to Learning
  • The volume of data requested of Learning
  • The frequency of calls to Learning (we can set a wait time between calls)
  • When you exceed a limit in one of your calls, we return an error to help you stay within the limit.
  • To ensure your operations are not negatively impacted, please retrieve data page by page in sequential order.

Pagination in SAP SuccessFactors Learning OData

To avoid pagination problems when calling SAP SuccessFactors Learning web services, we recommend using OData parameters to define your page sizes based on the records returned.

We set default page sizes for different web services based on the data returned or to protect the server from a call for too much data. In general, the page default page size is ten entities in a collection, but some web services might return different page sizes. For this reason, we do not recommend that you rely on the default page sizes.

Instead, use the standard OData pagination parameters to define the page sizes that you want. Use $count to get a count of the total records in your return, then use $top and $skip to page the results. You can also use $count to get a total count and to make sure that you have processed all records on the client.