SAP Knowledge Base Article - Public

3020377 - Learning OData API Metadata browser calls work differently between Production and Stage environments

Symptom

  • When pulling the metadata of a Learning OData API call via the browser, the same API call metadata is a protected resource on Production but the metadata works in Stage
  • An error happens when using the Production Learning URL to pull an OData API metadata via a browser

Environment

SAP SuccessFactors Learning

Reproducing the Issue

Example:

  1. Open up a browser such as Google Chrome
  2. In the URL bar put the metadata URL such as https://[StageBaseURL]/learning/odatav4/public/user/userlearning-service/v1/$metadata
  3. Access to the metadata is not blocked
  4. Update the URL from https://[StageBaseURL]/learning/odatav4/public/user/userlearning-service/v1/$metadata to https://[ProdBaseURL]/learning/odatav4/public/user/userlearning-service/v1/$metadata
  5. An error is seen as access to the metadata on a Production environment is a protected resource

Cause

This is currently expected behavior of the systems

Resolution

If attempting to pull the metadata of any API, it is best to always pass an Authorization token using an external tool to call the API

  1. Call /learning/oauth-api/rest/v1/token 
  2. Get the token
  3. Pass the token to the metadata that is needed such as https://[BaseURL]/learning/odatav4/public/user/userlearning-service/v1/$metadata

Use the Learning OData API guide (login is required) for information on how to use a token call along with all other Learning APIs that are available

Keywords

error, protected, resource, odata, api, call, browser, chrome, edge, stage, production, lms, learning, metadata , KBA , LOD-SF-LMS-ODA , Web Services OData , Problem

Product

SAP SuccessFactors Learning all versions