Access User management API from thrid party client

When logging in as an admin I can navigate to the account/user management page: /settings/users

With a look at the browsers development toolbar I can find an request to: /ocs/v2.php/cloud/users/details?offset=0&limit=25&search= which yields a list of all users on the system.

But doing the following:

export KEY='<app-password-of-an-admin-account>'
export USR='<ADMIN>'

curl --user "$USR:$KEY" '<host>/ocs/v2.php/cloud/users/details?offset=0&limit=25&search='

yields the following message: {"message":"CSRF check failed"} and an http status of 412

Is it possible to use this API from a third party client, and if so, how?

Hey, please check OCS APIs overview β€” Nextcloud latest Developer Manual latest documentation - OCS APIs require a header when used directly.

1 Like

Thanks! That’s the secret sauce!