Querying Domain Groups for Last Email Post

65 views
Skip to first unread message

python api development

unread,
Aug 3, 2011, 4:48:20 PM8/3/11
to google-app...@googlegroups.com
Greetings,

I have successfully gotten the python gdata API to list all groups, and via nested loop, list all group members.

Here is the code:
============================
#groupFeed=service.RetrieveAllGroups()
#for i in range(len(groupFeed)):
#    gName = groupFeed[i]['groupName']
#    gDesc = groupFeed[i]['description']
#    print "\n", gName, "\n\t\t", gDesc
#    gId = groupFeed[i]['groupId']
#    membersFeed = service.RetrieveAllMembers(gId)
#    for j in range(len(membersFeed)):
#        mName = membersFeed[j]['memberId']
#        print "\t\t\t\t", mName
===============================

HOWEVER, I am trying to print out the time and date of the last post made to each group.

After spending many hours researching, I am still unclear how to do this, and any assistance would be greatly appreciated.

Please forgive this n00b question, as I have never used python b4 yesterday.

Thanks in advance!!!!


Jay Lee

unread,
Aug 3, 2011, 8:47:16 PM8/3/11
to google-app...@googlegroups.com
Hi python api development,

  There's no direct way to achieve this via the APIs as there is no API to list posts to the group. You could however create a generic user account, add it as a member of the group so that it receives posts and then pull it's most recent email via IMAP. If you setup labels and filter rules in the account, it'd be possible to use one user account with many groups.

Jay

python api development

unread,
Aug 4, 2011, 11:32:17 AM8/4/11
to google-app...@googlegroups.com
Hi Jay,

Thanks so much for your response. 

What would it take to write the python API that lists/reads posts to groups?
What about one that lists/dumps only the headers (no body)?
I would imaging that this would be very valuable to the python community...

As we are dealing with over 500 groups, ideally we would not need to add account and implement IMAP w/ filters, but do directly from a python API.

Also, it there a way, via the python API, to get the "who can view members" group setting? ideally, there is an API that could get/set this setting?

Thank you in advance!



Jay Lee

unread,
Aug 4, 2011, 12:39:35 PM8/4/11
to google-app...@googlegroups.com
Hi python api development,

  There's no Google API to pull the posts from groups so there's no way to write a Python library to do it. The workaround I mentioned should be able to scale to 500 accounts though setting up the filters would be a manual process.

  There is not currently an API that can pull the Google Apps for Business detailed group settings such as "who can view members".

Jay

python api development

unread,
Aug 4, 2011, 1:31:53 PM8/4/11
to google-app...@googlegroups.com
Jay,

Thanks again for your prompt response. 

It is quite surprising, and, not very google-esque, how limited the APIs are.
What is the point of having an API for "Google Apps for Business" if detailed group settings cannot be seen/controlled via the API?

I appreciate your manual workaround suggestion, but this simply does not scale. 
We will have 1000 groups by the end of the month (and this is just one client).

Is there a way to request Google make their APIs more robust?
Does anyone know if Google has plans to upgrade their offerings? 
I imagine we cannot be the only organization that requires more robust APIs.

Alternatively, does anyone know of a less-limited provider? 
I like google, but this is a deal-breaker, and we must now look for a different solution / google competitor.




David Haley

unread,
Aug 4, 2011, 1:53:49 PM8/4/11
to Google Apps Domain Information and Management APIs
Hi,

> It is quite surprising, and, not very google-esque, how limited the APIs
> are.

Well, the APIs are an ongoing project, and it's worth noting that some
APIs exist that don't in other platforms, such as much of the Data
Liberation work.

In general, they tend to prioritize requests based on how many people
need it. Your particular use case of needing to extract the last 500
messages are rather unusual, as I understand it.

There are many ways around this, and honestly you could make them
scale. There are email feed APIs you can use, there's the IMAP
solution, etc. You could have a robot user in these groups and monitor
things that way. I think that your problem is solvable, just not in
the way you came in wanting it solved.

> Is there a way to request Google make their APIs more robust?

There are Google employees who read this list, so they'll be aware of
this.

> Does anyone know if Google has plans to upgrade their offerings?  
> I imagine we cannot be the only organization that requires more robust APIs.

Indeed. If you look around for this, you'll see that a new groups API
is already in the works.

http://groups.google.com/group/google-apps-mgmt-apis/browse_thread/thread/b1a3146d9eefd7ab/1863b3182b5350e5?lnk=gst&q=group+permission#1863b3182b5350e5

Cheers,
- David

Jay Lee

unread,
Aug 4, 2011, 2:09:15 PM8/4/11
to google-app...@googlegroups.com
David mentioned the API feeds (RSS, XML), they may be of some use to you:


Jay

Robert Norris

unread,
Aug 5, 2011, 12:49:41 AM8/5/11
to google-app...@googlegroups.com
On Fri, Aug 5, 2011 at 3:53 AM, David Haley <dch...@gmail.com> wrote:
There are many ways around this, and honestly you could make them
scale. There are email feed APIs you can use, there's the IMAP
solution, etc. You could have a robot user in these groups and monitor
things that way. I think that your problem is solvable, just not in
the way you came in wanting it solved.

The robot user is a method that works well - we're using it in my organisation to provide a record of messages sent to groups for compliance reasons.

The other option which we implemented with roaring success is a good old-fashioned screen scrape. The great thing about Google interfaces is that they're generated by a machine and thus pretty easy to parse. We wrote a library that exposes nearly every management setting from the Groups interface programatically and we use it to automatically create and synchronise groups with our central directory. We're doing similar things with Calendar to expose functions that aren't available via the API.

I stop short of calling this a recommendation because it adds some pretty significant development and maintenance overheads and of course you're left scrambling if Google changes something in the interface (which, to be fair, has happened once in two years for Groups). The benefit is that we've got tighter integrations between our corporate systems and Google Apps than can be achieved with the provided APIs, and our users are very happy about it.

Nothing is impossible, though it might take some time to get right :)

Cheers,
Rob.

Google Groups Details?

unread,
Aug 8, 2011, 6:17:18 PM8/8/11
to google-app...@googlegroups.com
WOW I am so happy someone posted this feature request for the API.

It is really frusterating that Google Groups for Business *details* cannot be seen and/or manipulated via the Python API.  

This is a necessary part of our workflow, and it does not make sense that google would implement something via the GUI that cannot be done via the API.   Does anyone know why they did this?  Wouldnt it make more sense to wait until the API is working before having a feature available via GUI?   Now we have put all this work into the "group details", for hundreds of groups, and the only way to see it / change it is to log in graphically?   to quote a prior post in this thread, this is very un-google-esque!!

I guess we could write something to dump and parse via lynx, but then as soon as something changes, our code becomes worthless.  this is the opposite of "scalable"

Google, please listen to your audience.   we need to view/change the group details settings via the API.  PLEASE!!

Also, it is important for us to be able to parse thru the thousands of archived group emails via python API.  I see that this is not possible either.  Someone actually suggested adding a "silent user" and use IMAP w/ filters.   This is neither manageable nor scalable (we have 1000's of groups)

GOOGLE, please fix these serious deficiencies and give us an ETA.

thnx in advance.

Robert Norris

unread,
Aug 8, 2011, 8:16:52 PM8/8/11
to google-app...@googlegroups.com
This is a necessary part of our workflow, and it does not make sense that google would implement something via the GUI that cannot be done via the API.   Does anyone know why they did this?  Wouldnt it make more sense to wait until the API is working before having a feature available via GUI?   Now we have put all this work into the "group details", for hundreds of groups, and the only way to see it / change it is to log in graphically?   to quote a prior post in this thread, this is very un-google-esque!!

Actually its entirely consistent with the way Google builds and updates services. They start by getting a basic service out there and then gradually improve and extend it in response to customer feedback. As has been noted elsewhere, there is a Groups API in the works.

Yes, it sucks if you're trying to do something that isn't currently supported, but interim measures (like screen scraping) do exist if you need the functionality urgently enough.
 
Also, it is important for us to be able to parse thru the thousands of archived group emails via python API.  I see that this is not possible either.  Someone actually suggested adding a "silent user" and use IMAP w/ filters.   This is neither manageable nor scalable (we have 1000's of groups)

As someone who has personally implemented this I can tell you that it is both manageable and scalable for tens of thousands of groups. We didn't use filters, instead opting to expose a search facility built on the back of X-GM-RAW search extension.

Cheers,
Rob.

Shraddha Gupta

unread,
Dec 28, 2011, 3:51:04 PM12/28/11
to google-app...@googlegroups.com
Hi,

The new Groups Settings API is recently launched that allows retrieval and updation of the detailed groups settings.
The reference guide to the API is documented here.

Refer this blogpost for setting up the API:

Hope you find it useful.

Thank you all, for your feedback.
Please keep us posted on your use cases and we will try to prioritize our work accordingly.

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

Reply all
Reply to author
Forward
0 new messages