Symptom
When getting learning history using below learning API call, the parameter certificateLink is returning null even when the criteria includeDeepLink is set to true.
GET /learning/odatav4/public/user/learningHistory/v1/learninghistorys?$filter=criteria/maxNumberToRetrieve eq 10 and criteria/includeDeepLink eq true
Environment
SAP SuccessFactors Learning
Reproducing the Issue
- Generate a learning OAuth token in LMS
- Encode to base64 format
- Open your API client application
- Generate access token through below API:
- POST /learning/oauth-api/rest/v1/token
- Run below API call:
- GET /learning/odatav4/public/user/learningHistory/v1/learninghistorys?$filter=criteria/maxNumberToRetrieve eq 10 and criteria/includeDeepLink eq true
Note: Please refer to help guide Obtaining an OAuth Token for more information on the replication steps.
Cause
There are few possible reasons for this issue. See below:
- The Reports permission Run User Certificate of Completion History Record Report is missing in the user's role that is needed by the learning API call to display the data of the parameter certificateLink.
- The API is an User API, meaning that it's targeted to be run as a User (user-based token). Although this is possible to run this API using an Admin-based token, the Certificate Link won't come this way.
Resolution
For cause # 1:
- Navigate to System Administration > Security > Role Management
- Search and edit the user role
- Add the below Reports permission:
- Run User Certificate of Completion History Record Report
For cause # 2:
Ensure the Certificate Link will come, while generating the token, make sure the token is an User-based token. See the payload below and the text highlighted in bold:
Keywords
learning, API call, API, OData, microservice, microservices, user/learningHistory/v1/learninghistorys, user/learningHistory/v1/metadata, learning history, history, certificateLink, learninghistorys, null, blank, certificateLink returning null, certificateLink returning blank , KBA , LOD-SF-LMS-ODA , Web Services OData , Problem