SAP Knowledge Base Article - Public

2989965 - Learning API user/learningHistory/v1/learninghistorys Returning Null for certificateLink Parameter - LMS

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

  1. Generate a learning OAuth token in LMS
  2. Encode to base64 format
  3. Open your API client application
  4. Generate access token through below API:
    • POST /learning/oauth-api/rest/v1/token
  5. 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:

  1. 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.
  2. 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:

    1. Navigate to System Administration > Security > Role Management
    2. Search and edit the user role
    3. 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:

        "grant_type":"client_credentials",
        "scope":{
          "userId":"MYADMIN",
          "companyId":"company_id",
          "userType":"user",
          "resourceType":"learning_public_api"
        }
    }

     

    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

    Product

    SAP SuccessFactors Learning all versions