RAM API to retrieve the users assigned to a particular User role?
Hello team,
We are looking for an API that will retrieve all the users who are assigned to a User role in a community.
We tried the getUserIDs() RAM API but it gives null pointer exception error. We are using RAM 7.5.0.2. Please advise?
Snippet code
------------------
try
{
RAMSession session = new RAMSession( "RAMURL", "ADMIN", "PASSWORD" );
RAMCommunity community = session.getCommunity("COMMUNITY NAME");
// Connect ram server
RAM1 ram1 = new RAMClient(new URL( "RAMURL" ), "ADMIN", "PASSWORD", null).getRAM1Webservice();
//Get User Roles for this community
RoleSO[] rolesArray = ram1.getRoles(community.getId());
//Get User IDs for each role
for(int i=0; i<rolesArray.length; i++){
System.out.println("Role Name: " + rolesArray[i].getName() + " Number of Users: " + rolesArray[i].getUserIDs().length);
}
session.release();
}
catch(Exception e){e.printStackTrace();}
Thanks in advance,
Regards,
Sripriya
One answer
That information isn't sent through any of the web/webservices/rest calls.