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
- Generate an admin token type.
- Use it to call the API /learning/public-api/rest/v1/current-user/item/learning-event
- 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 , Web Services OData , Problem