SAP Knowledge Base Article - Public

2831118 - 401 Unauthorized error while accessing the API from SAP S/4HANA Cloud Public Edition system

Symptom

401 Unauthorized error happens while accessing the API from SAP S/4HANA Cloud Public Edition system

Environment

SAP S/4HANA Cloud Public Edition

Reproducing the Issue

  1. Call the API myxxxxx-api.s4hana.ondemand.com/sap/opu/odata/sap/API_XXX to SAP S/4HANA Cloud Public Edition system
  2. Input the communication user credentials then get the 401 Unauthorized error

Cause

  • The password is not correct
  • Due to incorrect logon, the user is locked 

Resolution

  • Scenario 1:

Using the correct password, if you do not know the correct password, you can regenerate the password in the "Maintain Communication User" app

  • Scenario 2: 

Open the app "Display Technical User" app to unlock the communication user. If you want to check when the user is locked, please check the user change history in the app "Maintain Communication User"

Keywords

401 Unauthorized, Maintain Communication User, Display Technical User, incorrect Logon, API, calling API, user locked, cannot access API, no authorization to access API, 401 , KBA , BC-SRV-APS-COM , Maintain Communication System and Arrangement , Problem

Product

SAP S/4HANA Cloud Public Edition all versions