on 2021 Feb 06 3:38 PM
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
Request clarification before answering.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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 protect SAP SuccessFactors Learning services from overload.
We protect your services from purposeful or accidental overload by setting limits on: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.
User | Count |
---|---|
50 | |
9 | |
8 | |
6 | |
5 | |
5 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.