Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Method that returns all group members || query that returns all the rooms a user belong . #66

Open
JonCSgr opened this issue Dec 31, 2020 · 1 comment

Comments

@JonCSgr
Copy link

JonCSgr commented Dec 31, 2020

Hey and merry xmas .
I am looking for this : https://docs.rocket.chat/api/rest-api/methods/groups/members

I want to implement a method that removes all the rooms a users belongs to .

Can you help me with either a query that returns all the groups a user belongs to ( and a query for channels).

or a method that returns all the usernames of a group , i am trying to use .getUsernames but it always returns null ( i guess it's not fetching the data from the server)

Thank you for your time .

@JonCSgr
Copy link
Author

JonCSgr commented Dec 31, 2020

I am trying to implement this but no luck so far , getting
The parameter "roomId" or "roomName" is required [error-room-param-not-provided]"

public User[] getMembers(Group group) throws IOException {
    RocketChatClientResponse res = this.callBuilder.buildCall(RocketChatRestApiV1.GroupsMembers,null,group.getId());
    if (!res.isSuccessful())
        throw new IOException("The call to get the members of the Group was unsuccessful: \"" + res.getError() + "\"");

    if (!res.hasGroups())
        throw new IOException("Failed to get the members of the group");

    return res.getUsers();
}

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant