User Provisioning API Usage Struggles

Hi,

I am attempting to manage our nextcloud users from a seperate PHP app. I wanted to test this provisioning API from the command line using curl. I attempted to following curl command but I get a status code 997. I understand this is possibly to do with the “admin” user in the command not being logged in or maybe how nextcloud handles CSF tokens.

Any tips on where to go to from here. I’m not all that advanced on this sort of integration but I will keep attempting to get it to work.

Thanks for any examples / advice.

# curl http://admin:password@22.44.55.66/nextcloud/ocs/v1.php/cloud/users -H “OCS-APIRequest: true”

Response:

<?xml version="1.0"?> failure 997 Current user is not logged in

Attached XML response as editor removes the xml.

See attached.

Thanks.

@Col you found a solution? I try to write a nagios check for the serverinfo/api/v1/info