Small Tips and Tricks – Microsoft Graph API metadata

Hi All,
Greetings for the day!!!
We will keep exploring Microsoft Graph APIs. Today discussing one of the most important reference – Microsoft Graph API metadata
Using Graph APIs not only we could read / write data to Microsoft cloud services but can use request patterns to traverse through resources (Users / Groups / Teams / Messages / Drive …)
Billion $ question – What is Microsoft Graph API metadata ?
The metadata document helps us to understand the data model of the resources and relationships in Microsoft Graph
Microsoft Graph Metadata includes entity types (users, teams, groups, contentType, entitlementManagement, termsOfUseContainer, identityGovernance and so on…), complex types (signInActivity, assignedLicense, assignedPlan, authorizationInfo and so on…), enumerations (lifecycleTaskCategory, valueType, customTaskExtensionOperationStatus and so on…) which represents resources which we use in Microsoft Graph requests and responses
We can use the metadata to learn the relationships between entities in Microsoft Graph and establish URLs that navigate between those entities.
From this Microsoft Graph metadata document we will also get to know how many Microsoft Graph Entities are available. For ex – User, Groups, Teams, Channel and so on
This Microsoft metadata document is very useful while preparing for Microsoft Graph API queries as we got to know Graph resources (Entieits), Navigation properties – helpful to understand building complex queries, resources properties – properties – returned in query responses
The metadata document ($metadata) is published at the service root
We can see the metadata document for version v1.0 by navigating to – https://graph.microsoft.com/v1.0/$metadata

Following image shows “user” entity (Microsoft Graph resource) “properties“. These properties are returned in response of Microsoft Graph API query for user entity. So from this metadata document we got to know which are the properties are available.

Following image shows “NavigationProperties” of “user” entity (Microsoft Graph resource). Those navigation properties are used to buld the Microsoft Graph APIs queries

Following code represents “team” entity (Microsoft Graph resource). Teams properties and navigation properties
<EntityType Name="team" BaseType="graph.entity" OpenType="true">
<Property Name="classification" Type="Edm.String"/>
<Property Name="createdDateTime" Type="Edm.DateTimeOffset"/>
<Property Name="description" Type="Edm.String"/>
<Property Name="displayName" Type="Edm.String"/>
<Property Name="funSettings" Type="graph.teamFunSettings"/>
<Property Name="guestSettings" Type="graph.teamGuestSettings"/>
<Property Name="internalId" Type="Edm.String"/>
<Property Name="isArchived" Type="Edm.Boolean"/>
<Property Name="memberSettings" Type="graph.teamMemberSettings"/>
<Property Name="messagingSettings" Type="graph.teamMessagingSettings"/>
<Property Name="specialization" Type="graph.teamSpecialization"/>
<Property Name="summary" Type="graph.teamSummary"/>
<Property Name="tenantId" Type="Edm.String"/>
<Property Name="visibility" Type="graph.teamVisibilityType"/>
<Property Name="webUrl" Type="Edm.String"/>
<NavigationProperty Name="allChannels" Type="Collection(graph.channel)"/>
<NavigationProperty Name="channels" Type="Collection(graph.channel)" ContainsTarget="true"/>
<NavigationProperty Name="group" Type="graph.group"/>
<NavigationProperty Name="incomingChannels" Type="Collection(graph.channel)"/>
<NavigationProperty Name="installedApps" Type="Collection(graph.teamsAppInstallation)" ContainsTarget="true"/>
<NavigationProperty Name="members" Type="Collection(graph.conversationMember)" ContainsTarget="true"/>
<NavigationProperty Name="operations" Type="Collection(graph.teamsAsyncOperation)" ContainsTarget="true"/>
<NavigationProperty Name="permissionGrants" Type="Collection(graph.resourceSpecificPermissionGrant)" ContainsTarget="true"/>
<NavigationProperty Name="photo" Type="graph.profilePhoto" ContainsTarget="true"/>
<NavigationProperty Name="primaryChannel" Type="graph.channel" ContainsTarget="true"/>
<NavigationProperty Name="tags" Type="Collection(graph.teamworkTag)" ContainsTarget="true"/>
<NavigationProperty Name="template" Type="graph.teamsTemplate"/>
<NavigationProperty Name="schedule" Type="graph.schedule" ContainsTarget="true"/>

Similarly we have metadata document for beta version. We can see the metadata document for beta version by navigating to – https://graph.microsoft.com/beta/$metadata

REFERENCES
- Microsoft Graph – https://knowledge-junction.in/category/technology-articles/m365/microsoft-graph/
- Graph Explorer – https://knowledge-junction.in/category/technology-articles/small-tricks-and-tips/graph-explorer/
- Microsoft Graph PowerShell – https://knowledge-junction.in/category/technology-articles/m365/microsoft-graph/microsoft-graph-powershell/
Feel free to discuss about Microsoft Graph – HAPPY to HELP 🙂
Thanks for reading the article !!!
HAVE A GREAT LEARNING AHEAD !!! LIFE IS BEAUTIFUL 🙂

You must be logged in to post a comment.