|
| 1 | +--- |
| 2 | +title: Microsoft Graph API MemberOf Returns Null Values for Properties |
| 3 | +description: Provides a solution to an issue where some properties are indicated as null when you call the Microsoft Graph API memberOf. |
| 4 | +ms.date: 04/03/2025 |
| 5 | +ms.service: entra-id |
| 6 | +ms.reviewer: bhvootla, adoyle, nualex, v-weizhu |
| 7 | +ms.custom: sap:Problem with querying or provisioning resources |
| 8 | +--- |
| 9 | +# Microsoft Graph API memberOf returns null values for some properties |
| 10 | + |
| 11 | +This article provides a solution to an issue where some properties are indicated as `null` when you call the Microsoft Graph API `memberOf`. |
| 12 | + |
| 13 | +## Symptoms |
| 14 | + |
| 15 | +When calling one of the following APIs that can return the list of groups and directory roles that a user is a direct member of, you see `null` values for all properties except the object type and ID in the JSON response: |
| 16 | + |
| 17 | +```msgraph |
| 18 | +GET https://graph.microsoft.com/v1.0/me/memberOf |
| 19 | +``` |
| 20 | + |
| 21 | +```msgraph |
| 22 | +GET https://graph.microsoft.com/v1.0/users/{id | userPrincipalName}/memberOf |
| 23 | +``` |
| 24 | + |
| 25 | +Here's a sample JSON response: |
| 26 | + |
| 27 | +```json |
| 28 | +{ |
| 29 | + "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#directoryObjects", |
| 30 | + "value": [ |
| 31 | + { |
| 32 | + "@odata.type": "#microsoft.graph.group", |
| 33 | + "id": "00000003-0000-0000-c000-000000000000", |
| 34 | + "deletedDateTime": null, |
| 35 | + "classification": null, |
| 36 | + "createdDateTime": null, |
| 37 | + "creationOptions": [], |
| 38 | + "description": null, |
| 39 | + "displayName": null, |
| 40 | + "expirationDateTime": null, |
| 41 | + "groupTypes": [], |
| 42 | + "isAssignableToRole": null, |
| 43 | + "mail": null, |
| 44 | + "mailEnabled": null, |
| 45 | + "mailNickname": null, |
| 46 | + "membershipRule": null, |
| 47 | + "membershipRuleProcessingState": null |
| 48 | + } |
| 49 | + ] |
| 50 | +} |
| 51 | +``` |
| 52 | + |
| 53 | +## Cause |
| 54 | + |
| 55 | +When an application queries the membership that returns a `directoryObject` type collection, if it doesn't have permission to read a resource type, members of that type are returned with limited information. For example, only the object type and ID might be returned, and other properties are indicated as null. Complete information is returned for the object types that the application has permission to read. |
| 56 | + |
| 57 | +For more information, see [List a user's direct memberships](/graph/api/user-list-memberof) and [Limited information returned for inaccessible member objects](/graph/permissions-overview#limited-information-returned-for-inaccessible-member-objects). |
| 58 | + |
| 59 | +## Solution |
| 60 | + |
| 61 | +To get complete information, configure at least the `Directory.Read.All` permission for your application. |
| 62 | + |
| 63 | +[!INCLUDE [Azure Help Support](../../../includes/azure-help-support.md)] |
0 commit comments