Unable to retrieve members of a google group, gett

2020-04-08 12:32发布

问题:

I created a Google group from the Google Groups homepage and have added 5 users.

I am trying to use the Google Admin SDK API to retrieve the list of members from my group but whenever I try the API (from the API explorer) I get a 400 :

{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "invalid",
    "message": "Invalid Input"
   }
  ],
  "code": 400,
  "message": "Invalid Input"
 }
}

The request is :

GET https://www.googleapis.com/admin/directory/v1/groups/my-group-name%40googlegroups.com/members?key={MY_API_KEY}

My groupKey is urlencoded my-group-name@googlegroups.com

I tried using only my-group-name as the groupKey but I then get a 404 "Resource Not Found: groupKey"

I am logged in with the owner of the group and have all scopes required during the OAuth2 authentication.

回答1:

The Admin SDK groups API calls require Google Apps for Work or EDU. They do not work with consumer @googlegroups.com groups. There is no API to manage consumer googlegroups.com groups programatically.