Question

I'm using the Java client library for the Directory API from here: https://developers.google.com/api-client-library/java/apis/admin/directory_v1

I have insert user and insert group working fine, but for some reason when I try to insert a member, it doesn't work. There is no exception thrown. Here is the code:

        Member member = new Member();
        member.setEmail("someemail@mydomain.com");
        member.setRole("MEMBER");
        //member.setKind("admin#directory#member"); not sure if I need this. tried with and without
        member.setType("USER"); // docs say "MEMBER" but doesn't seem true. Tried both
        client.members().insert(myGroupId, member);
Was it helpful?

Solution

You don't need to set kind nor type. After "client.members().insert(myGroupId, member);" do you call execute ?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top