views:

61

answers:

1

I'm working on a GMail gagdget and am trying to access the current users ComanyName / Apps-Account-DomainName / ID. It has to be some ID thats unique for all users belonging to the same Google Apps Domain, for I like to display different content to different users beeing in the same Domain / Company.

Do you know if and how this is possible?

As far as I understand it, GMail sidebar gadgets are not able to access any of the current users data. They are just displayed within gmail, but don't interagate with it.

Unless you use OAuth to authenticate the user.

This for example shows how to get the users contacts:

http://gadget-doc-examples.googlecode.com/svn/trunk/opensocial-gadgets/oauth-contacts.xml

Observing the code you will see, that it uses a feed to access this data:

http://www.google.com/m8/feeds/contacts/default/base?alt=json

So maybe my question is: "Which feed do I have to access to get the Google Apps domain of the user?" Otherwise: Is it possible at all?

A: 

This piece of code solved my problem:

var domain = gadgets.util.getUrlParameters()['parent'].match(/.+\/a\/(.+)\/html/)[1];

Got the answer over here:

http://www.google.com/support/forum/p/apps-apis/thread?tid=3d0d1c7033431d79&hl=en

JochenJung