google-appsgoogle-groups-apigoogle-groups-settings

Need a workaround for listing/adding Google Groups


My use case needs API to access (list, add and edit) a user's Google Groups. The only available thing I have is the APIs to access and modify a Group's settings. This fulfils my "editing" needs but leaves me craving for "list" the groups and "add" a group APIs.

Is there a workaround so that I can list and add a Google Group? At worst, I need to have a call that can list me the email ids of the groups a user is part of.

Any help or alternatives is highly appreciated.


Solution

  • For listing groups, I think you can use the groups.list

    HTTP request:

    GET https://www.googleapis.com/admin/directory/v1/groups
    

    If successful, this method returns a response body with the following structure:

    {
      "kind": "admin#directory#groups",
      "etag": etag,
      "groups": [
        [groups Resource](https://developers.google.com/admin-sdk/directory/v1/reference/groups#resource)
      ],
      "nextPageToken": string
    }
    

    Read more on Group Management and Group members for additonal reference.