orgContact: getMemberGroups

Return all the groups that the organizational contact is a member of. The check is transitive, unlike reading the memberOf navigation property, which returns only the groups that the user is a direct member of.

This function supports Office 365 and other types of groups provisioned in Azure Active Directory (Azure AD). The maximum number of groups each request can return is 2046.

Note

Office 365 groups cannot contain groups. Membership in an Office 365 group is always direct.

Permissions

One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.

Permission type Permissions (from least to most privileged)
Delegated (work or school account) OrgContact.Read.All and Group.Read.All, Directory.Read.All
Delegated (personal Microsoft account) Not supported.
Application OrgContact.Read.All and Group.Read.All, Directory.Read.All

HTTP request

POST /contacts/{id}/getMemberGroups

Request headers

Header Value
Authorization Bearer {token}. Required.
Content-type application/json. Required.

Request body

In the request body, provide a JSON object with the following parameters.

Parameter Type Description
securityEnabledOnly Boolean Set to false. Returning only security-enabled groups is supported for users only.

Response

If successful, this method returns a 200 OK response code and a String collection object in the response body.

Example

Request

The following is an example of the request.

POST https://graph.microsoft.com/v1.0/contacts/{id}/getMemberGroups
Content-type: application/json
Content-length: 33

{
  "securityEnabledOnly": false
}
Response

The following is an example of the response.

Note: The response object shown here might be shortened for readability.

HTTP/1.1 200 OK
Content-type: application/json
Content-length: 39

{
  "value": [
    "groupId-value1",
    "groupId-value2"
  ]
}