SAP Knowledge Base Article - Public

2760288 - LMS OData API Error - "Unauthorized access to record learning event"

Symptom

Using the API to send completion status from an OCN provider to LMS is giving the following error:

{
     "errors": [
          {
               "code": "500",
               "message": "Unauthorized access to record learning event",
               "fieldName": null
          }
     ],
     "status": "FAILED",
     "operation": null,
     "data": null,
     "warnings": null
}

Environment

SuccessFactors LMS

Reproducing the Issue

  1. Generate an admin token type.
  2. Use it to call the API /learning/public-api/rest/v1/current-user/item/learning-event
  3. The error will happen.

Cause

This API was designed to work with user tokens only. Using an admin token type is what causes this error.

Resolution

You must a use a user token type for this API to work. Also, the userID passed on the payload must be the same userID that was used to generate the token. For example, if you generate a token for user 'A' and tries to call the API passing a userID 'B', a different error will happen.

Keywords

odata, api, ocn, error, failed, code 500, unauthorized , KBA , LOD-SF-LMS-ODA , LMS Web Services OData , Problem

Product

SAP SuccessFactors Learning 1811