0
static void addGroupMember(Directory client) throws Exception {
    String userEmail = "sample@mydomain.com";
    String groupEmail = "mygroup@mydomain.com";
    Member member=new Member();
    member.setEmail(userEmail);
    member.setRole("MEMBER");

    client.members().insert(groupEmail, member).execute();

    }

This is the code which i tried to add an existing member (sample@mydomain.com) to a group (mygroup@mydomain.com). when I am executing the code it is only creating a label inside the group.it is not linking the label with the existing user. how can i map the label with the existing user

user3269799
  • 33
  • 1
  • 7

1 Answers1

0

For existing members, you should be using PATCH or UPDATE methods to change the member's role in the group.

Jay Lee
  • 13,415
  • 3
  • 28
  • 59