OCS REST API Authentication Impossible

https://docs.nextcloud.com/server/22/developer_manual/client_apis/OCS/ocs-api-overview.html#testing-requests-with-curl

Applying this example from the documentation to the server accessible to me does not work.

<?xml version="1.0"?>
<ocs>
 <meta>
  <status>failure</status>
  <statuscode>997</statuscode>
  <message>Current user is not logged in</message>
  <totalitems></totalitems>
  <itemsperpage></itemsperpage>
 </meta>
 <data/>
</ocs>

Getting this response, no matter which account credentials are used, including users with administrator rights.

They don’t have MFA enabled.

I also researched all topics on this forum & search engine findings on this error & all the results were useless, because they were related to some weird authentication and/or user setup. In this case, there’s a standard Nextcloud installation with barely any apps installed.

for me it works perfectly on NC 26.0.1 with a non-admin user checking own userid… I see an error “failure” with status code 998 when looking for other users. didn’t test with admin user as I don’t have an admin without 2FA now…