Reputation: 541
I am trying to get all the members of a group using Directory API of Google Admin SDK.I have added all the users of my domain to this group using add all users in this domain button on admin panel of my domain. Apart from this I have also added one more user to this group. Hence there are two entries for this group. Directory API returns the following member list.
{
"kind": "admin#directory#members",
"etag": "\"geb3xcv_ZSaV25Ofefv5dh58nnk/LqxcrE5TnEAIfsL40kOhNX3fA8Y\"",
"members":
[
{
"kind": "admin#directory#member",
"etag": "\"geb3xcv_ZSaV25Ofefv5dh58nnk/kmhESKx70CkHpkdZmsTYGx6wdNs\"",
"id": "C037672zf5r",
"role": "MEMBER",
"type": "CUSTOMER"
},
{
"kind": "admin#directory#member",
"etag": "\"geb3xcv_ZSaV25Ofefv5dh58nnk/FVfFaFMLGYQMa2Ly8XA7uLEPLD8\"",
"id": "118196612we999272349516",
"email": "[email protected]",
"role": "MEMBER",
"type": "USER"
}
]
}
Member type for the first member is CUSTOMER. In document it has been mentioned that possible value for "type" attributes are GROUP, MEMBER and acceptable values are GROUP,USER.
What is the meaning of type CUSTOMER here. Will it returns type equal to customer for a member (shared with all users in domain).
Upvotes: 0
Views: 489
Reputation: 11
I found the same thing when using the Directory API. After much discussions with Google Enterprise Support, I got confirmation that the values for 'type' of a member resource is: 'GROUP' Member is another group 'USER' Member is a user 'CUSTOMER' Member represents every user in the domain (akin to 'Everyone' i AD)
They promised that the documentation would (eventually) be updated to reflect this.
Upvotes: 1
Reputation: 19835
This is documented here regarding the meaning and use of customerId: https://developers.google.com/admin-sdk/directory/v1/guides/manage-users.html#get_all_users
I found it hidden here: https://developers.google.com/admin-sdk/directory/v1/reference/users
Now, the remaining question for which I didnt find documentation is: can a domain have more than one customerId? If so, it would be safe to assume that if a group contains such type "CUSTOMER", we know all domain users are part of it, even in multi-domain gapps scenarios. Otherwise, seems painful to have to query the user manually against the "all users" api in my first link.
Upvotes: 1
Reputation: 111
Though this is not really documented, but what you say is very likely -- I also have added all users in my app org to a group, and getting a member type: CUSTOMER.
"kind": "admin#directory#members",
"etag": "\"geb3xXXXXXXXX\"",
"members": [
{
"kind": "admin#directory#member",
"etag": "\"geb3xcvXXXXXXXX\"",
"id": "C0XXXXXXXX",
"role": "MEMBER",
"type": "CUSTOMER"
}
Upvotes: 1