Symptom
When using ODATA learning History web service call without the filter criteria it fails (GET /learning/odatav4/public/user/learningHistory/v1/learninghistorys?) with the following error message.
- You may get the following error: Caused by: org.apache.olingo.client.api.communication.ODataClientErrorException: (null) The URI is malformed. [HTTP/1.1 400 ]
Environment
SAP SuccessFactors Learning
Reproducing the Issue
Run the call without the filter criteria (GET /learning/odatav4/public/user/learningHistory/v1/learninghistorys? $filter=criteria/maxNumberToRetrieve eq 10 and criteria/includeDeepLink eq true).
Cause
Filter is mandatory for this ODATA learningHistory api call. The API is not meant for a bulk data extraction or doing a search with wildcards.
The API is meant for accessing a single user's learning history along with a filter to restrict the number of records.
If you are using admin Token then you need to provide targetUserID in the filter. Use specific user Token then you need not to provide targetUserID in the filter.
This API is designed in such a way that it will allow to access a single user's learning history at a time.
Resolution
Provide the Criteria as below to the API call to fix the error.
GET /learning/odatav4/public/user/learningHistory/v1/learninghistorys?$filter=criteria/maxNumberToRetrieve eq 10 and criteria/includeDeepLink eq true
See Also
Keywords
learningHistory, learning, history, odata, api, call, get, uri, org.apache.olingo.client.api.communication.ODataClientErrorException, null, malformed, http, 400, org.apache.olingo.client.api.communication.ODataClientErrorException: (null) The URI is malformed. [HTTP/1.1 400] , KBA , LOD-SF-LMS-ODA , Web Services OData , Problem
SAP Knowledge Base Article - Public