Reputation: 991
I want to add members to Google group using AdminDirectory.Members.insert
.
This is my code:
function addGroupMember() {
var member = {
name: {
givenName: 'Jhon',
familyName: 'Doe'
},
email: '[email protected]',
role: 'MEMBER'
};
var newMember=AdminDirectory.Members.insert(member, '[email protected]');
}
The members is created into Group Members of Google Workspace, but without name, as you can see below:
There is one way to change Member
by John Doe
?
NOTE: The email domain is external, is not the same of the organization.
Upvotes: 0
Views: 877
Reputation: 2696
You may want to take a deeper look at the documentation.
From the Member
overview:
A Google Groups member can be a user or another group.
Also you can see that the Member
resource has no attribute name
so it's indeed impossible to assign it a name before creating the User
resource.
What you can do right now is creating an User
through the users.insert
request. After that store the id
of said user and insert it into a group with members.insert
.
And of course if you have already created a bunch of users without specifying the names you can update them.
Upvotes: 1