Provisioning API - Retrieve all groups for a [non google apps] member_id

112 views
Skip to first unread message

Gwyn Howell

unread,
Jul 10, 2012, 7:03:44 PM7/10/12
to google-app...@googlegroups.com
I am so sure that about 2 weeks ago I was using the following code (python):

client = gdata.apps.groups.client.GroupsProvisioningClient(domain=DOMAIN)

client.client_login(EMAIL, PASSWORD, SOURCE)
groups = client.retrieve_groups('random_email@random_domain.com', False)

where the member_id (marked in red) did not belong to the google apps domain. This makes sense, as you can add any email address to a group, so it makes sense to be able to query what groups an outside email belongs to within the google apps domain.

Only, today when I run the same code, I am getting EntityDoesNotExist errors, implying that the method only works for google apps email addresses.

Now, it is quite possible that I am mistaken, and I never queried the api for non google apps email addresses, but considering I wrote a considerable routine around this very concept (which is now utterly broken!) I am pretty sure I had it working in my testing.

I checked the docs to find the following ...
The required memberId (member_id in Python) argument identifies the ID of a hosted user for which you want to retrieve group subscriptions.
... the key phrase being "hosted user".


Does anyone know if this is possible? And if not, a workaround would be hugely helpful!

Thanks in advance

Alexandre Jacquet

unread,
Jul 10, 2012, 7:17:19 PM7/10/12
to google-app...@googlegroups.com

I think you have to retrieve every group and query the users inside a group.

For each group

Search members

--
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/-/KMGVtWa1yvMJ.
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.

Gwyn Howell

unread,
Jul 10, 2012, 7:19:26 PM7/10/12
to google-app...@googlegroups.com
Yeah, that's what I figured. It's extremely inefficient for what I need to do.

Thanks for your reply


On Wednesday, 11 July 2012 00:17:19 UTC+1, Alexandre Jacquet wrote:

I think you have to retrieve every group and query the users inside a group.

For each group

Search members

On Jul 10, 2012 8:03 PM, "Gwyn Howell" <gwyn....@appogee.co.uk> wrote:
I am so sure that about 2 weeks ago I was using the following code (python):

client = gdata.apps.groups.client.GroupsProvisioningClient(domain=DOMAIN)

client.client_login(EMAIL, PASSWORD, SOURCE)
groups = client.retrieve_groups('random_email@random_domain.com', False)

where the member_id (marked in red) did not belong to the google apps domain. This makes sense, as you can add any email address to a group, so it makes sense to be able to query what groups an outside email belongs to within the google apps domain.

Only, today when I run the same code, I am getting EntityDoesNotExist errors, implying that the method only works for google apps email addresses.

Now, it is quite possible that I am mistaken, and I never queried the api for non google apps email addresses, but considering I wrote a considerable routine around this very concept (which is now utterly broken!) I am pretty sure I had it working in my testing.

I checked the docs to find the following ...
The required memberId (member_id in Python) argument identifies the ID of a hosted user for which you want to retrieve group subscriptions.
... the key phrase being "hosted user".


Does anyone know if this is possible? And if not, a workaround would be hugely helpful!

Thanks in advance

--
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/-/KMGVtWa1yvMJ.
To post to this group, send email to google-apps-mgmt-apis@googlegroups.com.
To unsubscribe from this group, send email to google-apps-mgmt-apis+unsub...@googlegroups.com.

Alexandre Jacquet

unread,
Jul 10, 2012, 7:20:00 PM7/10/12
to google-app...@googlegroups.com

Uhmmm depends on what you need to do :-)

To view this discussion on the web visit https://groups.google.com/d/msg/google-apps-mgmt-apis/-/bWAA0lJL9h0J.
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.

Gwyn Howell

unread,
Jul 10, 2012, 7:23:38 PM7/10/12
to google-app...@googlegroups.com
I need to display all groups for the email address of a contact record. If the email address exists only in 1 group, then it would be inefficient to load all groups, then all members for each group in the entire domain, which could have tens of thousands of groups and users.


On Wednesday, 11 July 2012 00:20:00 UTC+1, Alexandre Jacquet wrote:

Uhmmm depends on what you need to do :-)

On Jul 10, 2012 8:19 PM, "Gwyn Howell wrote:
Yeah, that's what I figured. It's extremely inefficient for what I need to do.

Thanks for your reply

On Wednesday, 11 July 2012 00:17:19 UTC+1, Alexandre Jacquet wrote:

I think you have to retrieve every group and query the users inside a group.

For each group

Search members

On Jul 10, 2012 8:03 PM, "Gwyn Howell"  wrote:
I am so sure that about 2 weeks ago I was using the following code (python):

client = gdata.apps.groups.client.GroupsProvisioningClient(domain=DOMAIN)

client.client_login(EMAIL, PASSWORD, SOURCE)
groups = client.retrieve_groups('random_email@random_domain.com', False)

where the member_id (marked in red) did not belong to the google apps domain. This makes sense, as you can add any email address to a group, so it makes sense to be able to query what groups an outside email belongs to within the google apps domain.

Only, today when I run the same code, I am getting EntityDoesNotExist errors, implying that the method only works for google apps email addresses.

Now, it is quite possible that I am mistaken, and I never queried the api for non google apps email addresses, but considering I wrote a considerable routine around this very concept (which is now utterly broken!) I am pretty sure I had it working in my testing.

I checked the docs to find the following ...
The required memberId (member_id in Python) argument identifies the ID of a hosted user for which you want to retrieve group subscriptions.
... the key phrase being "hosted user".


Does anyone know if this is possible? And if not, a workaround would be hugely helpful!

Thanks in advance

--
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/-/KMGVtWa1yvMJ.
To post to this group, send email to google-apps-mgmt-apis@googlegroups.com.
To unsubscribe from this group, send email to google-apps-mgmt-apis+unsubscri...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/google-apps-mgmt-apis?hl=en.

Alexandre Jacquet

unread,
Jul 10, 2012, 7:28:59 PM7/10/12
to google-app...@googlegroups.com

Like load all groups the user belongs?

Or for a random email address search if it belongs to any group inside the domain?

To view this discussion on the web visit https://groups.google.com/d/msg/google-apps-mgmt-apis/-/IDhGlzrCR1wJ.
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.

Gwyn Howell

unread,
Jul 10, 2012, 7:30:53 PM7/10/12
to google-app...@googlegroups.com
Yeah

Alexandre Jacquet

unread,
Jul 10, 2012, 7:39:59 PM7/10/12
to google-app...@googlegroups.com

Well in the first case you probably will provide the email address and retrieve the list or null of groups this user belongs, and check the provisioning api

https://developers.google.com/google-apps/provisioning/#retrieving_all_groups_for_a_member

But this is valid only for your domain email list. If I'm not mistaken hehe..

In the second scenario you have to search group by group or create an external source which contains the groups and members to enhance performance something like that...

On Jul 10, 2012 8:30 PM, "Gwyn Howell" <gwyn....@appogee.co.uk> wrote:
Yeah

--
You received this message because you are subscribed to the Google Groups "Google Apps Domain Information and Management APIs" group.
Reply all
Reply to author
Forward
0 new messages