Retrieve Confluence Users either from a Rest API or Java SDK

Hi there! I’m a newbie to Confluence and I’m trying the pull all the Confluence Users. The user details should include info should also include the status of the user and the groups to which they belong.
I have not found any relevant information around this so far. Any help will be greatly appreciated