0

I want to get a list of groups where i have member access and also i want to know which role I have in those Google groups.

for example, assume a user is a member of 70 groups. Through admin console I can check which role is assigned to that particular user, But its a lengthy process.

Can I list Google groups,where a user has membership access(atleast) along with the role(member,manager or owner) assigned to the user in those groups.

I would like to do it using Google App Script.

Thanks in advance

Kanchan
  • 65
  • 2
  • 11

1 Answers1

1

You can use the Group:list API where a userKey can be specified. It returns all the groups the user is a member of. Use the following HTTP request and include the authorization described in Authorize requests .

There's a JSON request were you can get the role of the group member, a group member's role can be (OWNER, MANAGER, MEMBER).

Here's a successful response returns an HTTP 200 status code and the member's information:

{
"kind": "directory#member",
"id": "group member's unique ID",
"email": "liz@example.com",
"role": "MEMBER",
"type": "GROUP"
}

For more information regarding Group members, click here: https://developers.google.com/admin-sdk/directory/v1/guides/manage-group-members#create_member

Android Enthusiast
  • 4,826
  • 2
  • 15
  • 30
  • Thanks for the information..I have tried this already.. But i dont want this one. I am talking about the scenario as below- When we search a user in admin console it will list all the groups in which user has atleast member access to those groups. I was asking whether this is possible through app script or not.. Thanks in advance..:) – Kanchan May 19 '16 at 07:49
  • If you are looking for Apps Script solution you need to specify that in your question and the tags. – Jay Lee Jun 21 '16 at 11:46
  • Updated question..Also can you please tell me how to access email id from the above JSON output. I only need the output as below- email : useremail id – Kanchan Aug 20 '16 at 18:36
  • Check this: https://developers.google.com/apps-script/advanced/admin-sdk-directory – Android Enthusiast Oct 03 '16 at 04:27