No way to distinguish users from groups when retrieving the members of a group

67 views
Skip to first unread message

laurent kubaski

unread,
Jan 7, 2012, 4:20:55 PM1/7/12
to google-app...@googlegroups.com

Hi everyone,

In the Google Apps administration console, I've created a group that contains another group and a user.

I've tried to retrieve the members of this group using this method: http://code.google.com/intl/fr/googleapps/domain/provisioning_API_v2_developers_guide.html#Retrieve_Member_Example

(I'm using the Java client library by the way).

Unfortunately, the returned feed doesn't seem to contain any information that would enable me to distinguish which entry is a user and which one is an group. More precisely, both users and group names are returned in the 'memberId' element of the feed and the 'groupId' element is always empty.

Did I miss something ?

Shraddha Gupta

unread,
Jan 8, 2012, 8:29:41 AM1/8/12
to google-app...@googlegroups.com
Hello laurent,

The entry for a member includes the attributes memberId, memberType, directMember.
If the member is a group, the attribute memberType contains the value 'Group', else it is 'User'

The documentation does not show all attributes. Thanks for taking our attention to that. We will update that soon.
Please refer this xml entry returned for a member

<entry>
    <id>
    <updated>2012-01-08T13:22:48.912Z</updated>
    <link rel='self' type='application/atom+xml'
    <link rel='edit' type='application/atom+xml'
    <apps:property name='memberType' value='User' />
    <apps:property name='memberId' value='user...@domain.com' />
    <apps:property name='directMember' value='true' />
  </entry>

So, use the element memberType to know whether the entry is 'User' or a 'Group'

Thank you,
Shraddha Gupta
Developer Programs Engineer
Hyderabad, Google India.



--
You received this message because you are subscribed to the Google Groups "Google Apps Domain Information and Management APIs" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-apps-mgmt-apis/-/V0bXh3-y5lkJ.
To post to this group, send email to google-app...@googlegroups.com.
To unsubscribe from this group, send email to google-apps-mgmt...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-apps-mgmt-apis?hl=en.

laurent kubaski

unread,
Jan 9, 2012, 4:39:33 AM1/9/12
to google-app...@googlegroups.com
Thanks a lot for the feedback : I was using the various AppsGroupsService.APPS_PROP_GROUP_XXX constants to retrieve the GenericEntry properties and there is indeed no APPS_PROP_GROUP_MEMBER_TYPE constant.

Shraddha Gupta

unread,
Jan 9, 2012, 6:38:32 AM1/9/12
to google-app...@googlegroups.com
Please try giving the constant "memberType" for retrieving the memberType.
I am sorry that this constant is not included in the class. 
We will try to update the class as soon as possible.

Thanks,

Shraddha Gupta
Developer Programs Engineer
Hyderabad, Google India.



On Mon, Jan 9, 2012 at 3:09 PM, laurent kubaski <laurent...@gmail.com> wrote:
Thanks a lot for the feedback : I was using the various AppsGroupsService.APPS_PROP_GROUP_XXX constants to retrieve the GenericEntry properties and there is indeed no APPS_PROP_GROUP_MEMBER_TYPE constant.

--
You received this message because you are subscribed to the Google Groups "Google Apps Domain Information and Management APIs" group.

Chet

unread,
Jan 9, 2012, 9:19:48 AM1/9/12
to Google Apps Domain Information and Management APIs
Any plan to expose whether a member is a 'Manager' in the API?
Currently, there is a method to determine if a user is an 'Owner' or
if a 'User' or if a 'Group' but there does not seem to be a method via
API to determine 'Manager'.

On Jan 8, 8:29 am, Shraddha Gupta <shradd...@google.com> wrote:
> Hello laurent,
>
> The entry for a member includes the attributes memberId, memberType,
> directMember.
> If the member is a group, the attribute memberType contains the value
> 'Group', else it is 'User'
>
> The documentation does not show all attributes. Thanks for taking our
> attention to that. We will update that soon.
> Please refer this xml entry returned for a member
>
> <entry>
>     <id>
>
> https://apps-apis.google.com/a/feeds/group/2.0/srkapps.com/trial/memb...
> </id>
>     <updated>2012-01-08T13:22:48.912Z</updated>
>     <link rel='self' type='application/atom+xml'
>     href='https://apps-apis.google.com/a/feeds/group/2.0/srkapps.com/trial/memb...>
>     <link rel='edit' type='application/atom+xml'
>     href='https://apps-apis.google.com/a/feeds/group/2.0/srkapps.com/trial/memb...>
>     <apps:property name=*'memberType*' value='User' />
>     <apps:property name=*'memberId*' value='usern...@domain.com' />
>     <apps:property name='*directMember*' value='true' />
>   </entry>
>
> So, use the element memberType to know whether the entry is 'User' or a
> 'Group'
>
> Thank you,
> Shraddha Gupta
> Developer Programs Engineer
> Hyderabad, Google India.
>
> On Sun, Jan 8, 2012 at 2:50 AM, laurent kubaski
> <laurent.kuba...@gmail.com>wrote:
>
>
>
>
>
>
>
> > Hi everyone,
>
> > In the Google Apps administration console, I've created a group that
> > contains another group and a user.
>
> > I've tried to retrieve the members of this group using this method:
> >http://code.google.com/intl/fr/googleapps/domain/provisioning_API_v2_...

Shraddha Gupta

unread,
Jan 9, 2012, 10:14:22 AM1/9/12
to google-app...@googlegroups.com
Hi,

This is already a feature request in apps issues tracker.
There is no exact ETA when 'manager' for groups will be exposed though API, but we are planning to include this feature in the API based on developers requests.
You can star this issue in the issue tracker and you will be notified through mail whenever we update it.

Thanks for your feedback,

Shraddha Gupta
Developer Programs Engineer
Hyderabad, Google India.



Reply all
Reply to author
Forward
0 new messages