Authentication problem while getting the "serverinfo" - URL

Hi folks,

I’ve just set up a new nextcloud instance, which is working fine so far.
Now I would like to read ouf the serverinfo URL ("…/nextcloud/ocs/v2.php/apps/serverinfo/api/v1/info") by an external monitoring tool, but I’m struggeling to get around the authentication; whatever I call I end up with the logon page.

This doesn’t work
https://username:password.@host/nextcloud/ocs/v2.php/apps/serverinfo/api/v1/info

as well as this one:
https://username:password.@host/nextcloud/index.php/login?redirect_url=%252Fnextcloud%252Focs%252Fv2.php%252Fapps%252Fserverinfo%252Fapi%252Fv1%252Finfo

Did somebody try this before and has a hint for me?

Thanks
Ingo

Doesn’t help with your authentication problem. Take a look at munin. That’s a software made for monitoring, especially over network.

Yeah, thanks for that hint.
But there must be a way to call this page, otherwise it’s completely useless. :wink:

You probably also need to send a OCS-APIRequest: true HTTP header. Then the endpoint should work.

Thanks Lukas, that pointed me to the right direction.

Unfortunately now I get a

(405) Method Not Allowed. when sending as a POST request,
997 Unauthorised when sending a GET request.

So I assume “POST” is the correct method, nevertheless I do not reach my goal.
Can I get more debug information anywhere ?