0

I am trying to write a script that will save all users of a Group address to a spreadsheet. I am running into a problem with groups that I am not a member of. (this works fine if I am a member or owner of the group)

If i go to https://groups.google.com/a/(domain)/forum/#!members/(groupname) I can view all of the members of the group. However when I try to program this out using:

    var group = GroupsApp.getGroupByEmail(GROUP_EMAIL);
    var users = group.getUsers();

I get: "You do not have permission to view the member list for the group:" for groups that I am not currently a member/owner of. For the sake of not having to add me to every group, is there a way to get this to work with out needing access to the AdminDirectory?

When I tried with AdminDirectory, I get:

{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "forbidden",
    "message": "Not Authorized to access this resource/api"
   }
  ],
  "code": 403,
  "message": "Not Authorized to access this resource/api"
 }
}

I would think there would be since I can view all members from the http address that I listed above, even while not a member

tehhowch
  • 9,645
  • 4
  • 24
  • 42
  • Which is really an intended behavior. "The GroupsApp service uses the permissions of the GROUP to determine whether or not you can view the members list" as what was described in this [SO post](https://stackoverflow.com/questions/30179383/google-groups-api-getusers-you-do-not-have-permission-to-view-the-member-lis). You can follow the suggested action from this [SO answer](https://stackoverflow.com/questions/30179383/google-groups-api-getusers-you-do-not-have-permission-to-view-the-member-lis). – MαπμQμαπkγVπ.0 Nov 09 '18 at 10:22
  • Possible duplicate of [Google Groups API - getUsers() You do not have permission to view the member list for the group:](https://stackoverflow.com/questions/30179383/google-groups-api-getusers-you-do-not-have-permission-to-view-the-member-lis) – tehhowch Jan 31 '19 at 20:50

0 Answers0