Microsoft.Graph.Core
3.1.13
Prefix Reserved
See the version list below for details.
dotnet add package Microsoft.Graph.Core --version 3.1.13
NuGet\Install-Package Microsoft.Graph.Core -Version 3.1.13
<PackageReference Include="Microsoft.Graph.Core" Version="3.1.13" />
paket add Microsoft.Graph.Core --version 3.1.13
#r "nuget: Microsoft.Graph.Core, 3.1.13"
// Install Microsoft.Graph.Core as a Cake Addin #addin nuget:?package=Microsoft.Graph.Core&version=3.1.13 // Install Microsoft.Graph.Core as a Cake Tool #tool nuget:?package=Microsoft.Graph.Core&version=3.1.13
Microsoft Graph .NET Core Client Library
Integrate the Microsoft Graph API into your .NET project!
The Microsoft Graph .NET Core Client Library contains core classes and interfaces used by Microsoft.Graph Client Library to send native HTTP requests to Microsoft Graph API. The latest core client library targets .NetStandard 2.0.
Installation via NuGet
To install the client library via NuGet:
- Search for
Microsoft.Graph.Core
in the NuGet Library, or - Type
Install-Package Microsoft.Graph.Core
into the Package Manager Console.
Getting started
1. Register your application
Register your application to use Microsoft Graph API by following the steps at Register your application with the Microsoft identity platform.
2. Authenticate for the Microsoft Graph service
The Microsoft Graph .NET Client Library supports the use of TokenCredential classes in the Azure.Identity library.
You can read more about available Credential classes here and examples on how to quickly setup TokenCredential instances can be found here.
The recommended library for authenticating against Microsoft Identity (Azure AD) is MSAL.
For an example of authenticating a UWP app using the V2 Authentication Endpoint, see the Microsoft Graph UWP Connect Library.
3. Create a HttpClient object with an authentication provider
You can create an instance of HttpClient that is pre-configured for making requests to Microsoft Graph APIs using GraphClientFactory
.
HttpClient httpClient = GraphClientFactory.Create( version: "beta");
For more information on initializing a client instance, see the library overview
4. Make requests to the graph
Once you have an authenticated HttpClient
, you can begin to make calls to the service. The requests to the service follows our REST API syntax.
For example, to retrieve a user's default drive:
HttpRequestMessage requestMessage = new HttpRequestMessage(HttpMethod.Get, "me/drive");
HttpResponseMessage response = await httpClient.SendAsync(requestMessage);
if (response.IsSuccessStatusCode)
{
string jsonResponse = await response.Content.ReadAsStringAsync();
}
To get the current user's root folder of their default drive:
HttpRequestMessage requestMessage = new HttpRequestMessage(HttpMethod.Get, "me/drive/root");
HttpResponseMessage response = await httpClient.SendAsync(requestMessage);
if (response.IsSuccessStatusCode)
{
string jsonResponse = await response.Content.ReadAsStringAsync();
}
Documentation and resources
Notes
Install System.Runtime.InteropServices.RuntimeInformation before you install Microsoft.Graph >=1.3 if you are having an issue updating the package for a Xamarin solution. You may need to updated references to Microsoft.NETCore.UniversalWindowsPlatform to >=5.2.2 as well.
Issues
To view or log issues, see issues.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.
Other resources
- NuGet Package: https://www.nuget.org/packages/Microsoft.Graph.Core
Building library locally
If you are looking to build the library locally for the purposes of contributing code or running tests, you will need to:
- Have the .NET Core SDK (> 1.0) installed
- Run
dotnet restore
from the command line in your package directory - Run
nuget restore
andmsbuild
from CLI or run Build from Visual Studio to restore Nuget packages and build the project
Run
dotnet build -p:IncludeMauiTargets=true
if you wish to build the MAUI targets for the projects as well.
License
Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT license. See Third Party Notices for information on the packages referenced via NuGet.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.6.2
- Microsoft.IdentityModel.Protocols.OpenIdConnect (>= 7.6.2)
- Microsoft.Kiota.Abstractions (>= 1.9.6 && < 2.0.0)
- Microsoft.Kiota.Authentication.Azure (>= 1.1.7 && < 2.0.0)
- Microsoft.Kiota.Http.HttpClientLibrary (>= 1.4.3 && < 2.0.0)
- Microsoft.Kiota.Serialization.Form (>= 1.2.5 && < 2.0.0)
- Microsoft.Kiota.Serialization.Json (>= 1.3.3 && < 2.0.0)
- Microsoft.Kiota.Serialization.Multipart (>= 1.1.5 && < 2.0.0)
- Microsoft.Kiota.Serialization.Text (>= 1.2.2 && < 2.0.0)
- System.Net.Http.WinHttpHandler (>= 6.0.0 && < 9.0.0)
-
.NETStandard 2.0
- Microsoft.IdentityModel.Protocols.OpenIdConnect (>= 7.6.2)
- Microsoft.Kiota.Abstractions (>= 1.9.6 && < 2.0.0)
- Microsoft.Kiota.Authentication.Azure (>= 1.1.7 && < 2.0.0)
- Microsoft.Kiota.Http.HttpClientLibrary (>= 1.4.3 && < 2.0.0)
- Microsoft.Kiota.Serialization.Form (>= 1.2.5 && < 2.0.0)
- Microsoft.Kiota.Serialization.Json (>= 1.3.3 && < 2.0.0)
- Microsoft.Kiota.Serialization.Multipart (>= 1.1.5 && < 2.0.0)
- Microsoft.Kiota.Serialization.Text (>= 1.2.2 && < 2.0.0)
-
net6.0
- Microsoft.IdentityModel.Protocols.OpenIdConnect (>= 7.6.2)
- Microsoft.Kiota.Abstractions (>= 1.9.6 && < 2.0.0)
- Microsoft.Kiota.Authentication.Azure (>= 1.1.7 && < 2.0.0)
- Microsoft.Kiota.Http.HttpClientLibrary (>= 1.4.3 && < 2.0.0)
- Microsoft.Kiota.Serialization.Form (>= 1.2.5 && < 2.0.0)
- Microsoft.Kiota.Serialization.Json (>= 1.3.3 && < 2.0.0)
- Microsoft.Kiota.Serialization.Multipart (>= 1.1.5 && < 2.0.0)
- Microsoft.Kiota.Serialization.Text (>= 1.2.2 && < 2.0.0)
-
net6.0-android31.0
- Microsoft.IdentityModel.Protocols.OpenIdConnect (>= 7.6.2)
- Microsoft.Kiota.Abstractions (>= 1.9.6 && < 2.0.0)
- Microsoft.Kiota.Authentication.Azure (>= 1.1.7 && < 2.0.0)
- Microsoft.Kiota.Http.HttpClientLibrary (>= 1.4.3 && < 2.0.0)
- Microsoft.Kiota.Serialization.Form (>= 1.2.5 && < 2.0.0)
- Microsoft.Kiota.Serialization.Json (>= 1.3.3 && < 2.0.0)
- Microsoft.Kiota.Serialization.Multipart (>= 1.1.5 && < 2.0.0)
- Microsoft.Kiota.Serialization.Text (>= 1.2.2 && < 2.0.0)
-
net6.0-ios16.1
- Microsoft.IdentityModel.Protocols.OpenIdConnect (>= 7.6.2)
- Microsoft.Kiota.Abstractions (>= 1.9.6 && < 2.0.0)
- Microsoft.Kiota.Authentication.Azure (>= 1.1.7 && < 2.0.0)
- Microsoft.Kiota.Http.HttpClientLibrary (>= 1.4.3 && < 2.0.0)
- Microsoft.Kiota.Serialization.Form (>= 1.2.5 && < 2.0.0)
- Microsoft.Kiota.Serialization.Json (>= 1.3.3 && < 2.0.0)
- Microsoft.Kiota.Serialization.Multipart (>= 1.1.5 && < 2.0.0)
- Microsoft.Kiota.Serialization.Text (>= 1.2.2 && < 2.0.0)
- System.Runtime.InteropServices.NFloat.Internal (>= 6.0.1)
-
net6.0-maccatalyst16.1
- Microsoft.IdentityModel.Protocols.OpenIdConnect (>= 7.6.2)
- Microsoft.Kiota.Abstractions (>= 1.9.6 && < 2.0.0)
- Microsoft.Kiota.Authentication.Azure (>= 1.1.7 && < 2.0.0)
- Microsoft.Kiota.Http.HttpClientLibrary (>= 1.4.3 && < 2.0.0)
- Microsoft.Kiota.Serialization.Form (>= 1.2.5 && < 2.0.0)
- Microsoft.Kiota.Serialization.Json (>= 1.3.3 && < 2.0.0)
- Microsoft.Kiota.Serialization.Multipart (>= 1.1.5 && < 2.0.0)
- Microsoft.Kiota.Serialization.Text (>= 1.2.2 && < 2.0.0)
- System.Runtime.InteropServices.NFloat.Internal (>= 6.0.1)
-
net6.0-macos13.0
- Microsoft.IdentityModel.Protocols.OpenIdConnect (>= 7.6.2)
- Microsoft.Kiota.Abstractions (>= 1.9.6 && < 2.0.0)
- Microsoft.Kiota.Authentication.Azure (>= 1.1.7 && < 2.0.0)
- Microsoft.Kiota.Http.HttpClientLibrary (>= 1.4.3 && < 2.0.0)
- Microsoft.Kiota.Serialization.Form (>= 1.2.5 && < 2.0.0)
- Microsoft.Kiota.Serialization.Json (>= 1.3.3 && < 2.0.0)
- Microsoft.Kiota.Serialization.Multipart (>= 1.1.5 && < 2.0.0)
- Microsoft.Kiota.Serialization.Text (>= 1.2.2 && < 2.0.0)
- System.Runtime.InteropServices.NFloat.Internal (>= 6.0.1)
-
net6.0-windows7.0
- Microsoft.IdentityModel.Protocols.OpenIdConnect (>= 7.6.2)
- Microsoft.Kiota.Abstractions (>= 1.9.6 && < 2.0.0)
- Microsoft.Kiota.Authentication.Azure (>= 1.1.7 && < 2.0.0)
- Microsoft.Kiota.Http.HttpClientLibrary (>= 1.4.3 && < 2.0.0)
- Microsoft.Kiota.Serialization.Form (>= 1.2.5 && < 2.0.0)
- Microsoft.Kiota.Serialization.Json (>= 1.3.3 && < 2.0.0)
- Microsoft.Kiota.Serialization.Multipart (>= 1.1.5 && < 2.0.0)
- Microsoft.Kiota.Serialization.Text (>= 1.2.2 && < 2.0.0)
NuGet packages (39)
Showing the top 5 NuGet packages that depend on Microsoft.Graph.Core:
Package | Downloads |
---|---|
Microsoft.Graph
Microsoft Graph Client Library allows you to call Office 365, Azure AD and other Microsoft services through a single unified developer experience. |
|
Microsoft.Graph.Auth
Microsoft Graph Authentication Library implements authentication functionality used by Microsoft Graph Client Library. It provides a set of OAuth scenario-centric providers that implement Microsoft.Graph.IAuthenticationProvider and uses Microsoft Authentication Library (MSAL) to handle access token acquisition and storage. |
|
Microsoft.Graph.Beta
Microsoft Graph beta client library allows you to target the Microsoft Graph /beta endpoint. You can call Office 365, Azure AD and other Microsoft services through a single unified developer experience. |
|
PnP.Framework
PnP Framework contains the PnP Provisioning engine and a ton of extension methods that will make you more productive while developing for Microsoft 365. |
|
Microsoft.Graph.Communications.Core
Microsoft Graph Communications Client Core Library - This library builds on the Microsoft.Graph SDK to provide better support for the Communications APIs. |
GitHub repositories (25)
Showing the top 5 popular GitHub repositories that depend on Microsoft.Graph.Core:
Repository | Stars |
---|---|
ONLYOFFICE/CommunityServer
Free open source office suite with business productivity tools: document and project management, CRM, mail aggregator.
|
|
pnp/PnP
SharePoint / Office 365 Developer Patterns and Practices - Archived older solutions. Please see https://aka.ms/m365pnp for updated guidance
|
|
OfficeDev/Microsoft-Teams-Samples
Welcome to the Microsoft Teams samples repository. Here you will find task-focused samples in C#, JavaScript and TypeScript to help you get started with the Microsoft Teams App!
|
|
pnp/PnP-PowerShell
SharePoint PnP PowerShell CmdLets
|
|
microsoftgraph/msgraph-sdk-powershell
Powershell SDK for Microsoft Graph
|
Version | Downloads | Last updated |
---|---|---|
3.1.22 | 569,464 | 9/26/2024 |
3.1.21 | 517,100 | 9/4/2024 |
3.1.20 | 18,942 | 8/28/2024 |
3.1.19 | 209,539 | 8/26/2024 |
3.1.18 | 1,157 | 8/26/2024 |
3.1.17 | 14,530 | 8/19/2024 |
3.1.16 | 5,307 | 8/15/2024 |
3.1.15 | 22,551 | 8/9/2024 |
3.1.14 | 39,629 | 7/24/2024 |
3.1.13 | 70,204 | 7/3/2024 |
3.1.12 | 3,720,354 | 5/28/2024 |
3.1.11 | 987,703 | 4/30/2024 |
3.1.10 | 1,120,247 | 3/28/2024 |
3.1.9 | 500,488 | 3/18/2024 |
3.1.8 | 1,283,130 | 2/16/2024 |
3.1.8-preview.1 | 119 | 2/27/2024 |
3.1.7 | 291,582 | 2/9/2024 |
3.1.6 | 1,764,588 | 1/23/2024 |
3.1.5 | 347,578 | 1/15/2024 |
3.1.4 | 37,569 | 1/9/2024 |
3.1.3 | 1,003,565 | 11/29/2023 |
3.1.2 | 1,140,914 | 11/15/2023 |
3.1.1 | 234,161 | 11/7/2023 |
3.1.0 | 372,899 | 10/24/2023 |
3.0.11 | 1,201,758 | 9/5/2023 |
3.0.11-preview.1 | 234 | 9/1/2023 |
3.0.10 | 817,237 | 8/8/2023 |
3.0.10-preview.1 | 726 | 7/13/2023 |
3.0.9 | 1,047,070 | 6/29/2023 |
3.0.9-preview.1 | 217 | 6/29/2023 |
3.0.8 | 10,093 | 6/27/2023 |
3.0.7 | 680,800 | 5/30/2023 |
3.0.6 | 1,343,722 | 4/18/2023 |
3.0.6-preview.1 | 199 | 4/18/2023 |
3.0.5 | 644,231 | 3/30/2023 |
3.0.4 | 162,401 | 3/27/2023 |
3.0.3 | 211,960 | 3/21/2023 |
3.0.2 | 169,022 | 3/13/2023 |
3.0.1 | 136,225 | 3/7/2023 |
3.0.0 | 201,397 | 2/28/2023 |
3.0.0-rc.6 | 8,981 | 2/9/2023 |
3.0.0-rc.5 | 4,457 | 1/26/2023 |
3.0.0-rc.4 | 285 | 1/25/2023 |
3.0.0-rc.3 | 3,763 | 1/18/2023 |
3.0.0-rc.2 | 1,852 | 1/11/2023 |
3.0.0-rc.1 | 12,007 | 12/16/2022 |
3.0.0-preview.19 | 286 | 12/14/2022 |
3.0.0-preview.18 | 445 | 12/6/2022 |
3.0.0-preview.17 | 102,001 | 11/23/2022 |
3.0.0-preview.16 | 121,986 | 10/18/2022 |
3.0.0-preview.15 | 471 | 10/3/2022 |
3.0.0-preview.14 | 6,917 | 9/28/2022 |
3.0.0-preview.13 | 2,441 | 9/6/2022 |
3.0.0-preview.12 | 464 | 8/29/2022 |
3.0.0-preview.11 | 80,820 | 7/20/2022 |
3.0.0-preview.10 | 2,320 | 7/13/2022 |
3.0.0-preview.9 | 21,934 | 6/21/2022 |
3.0.0-preview.8 | 2,117 | 6/9/2022 |
3.0.0-preview.7 | 1,551 | 5/31/2022 |
3.0.0-preview.6 | 6,042 | 5/20/2022 |
3.0.0-preview.5 | 13,891 | 5/4/2022 |
3.0.0-preview.4 | 4,026 | 4/13/2022 |
3.0.0-preview.3 | 361 | 4/12/2022 |
3.0.0-preview.2 | 1,459 | 4/1/2022 |
3.0.0-preview.1 | 2,325 | 3/22/2022 |
2.0.15 | 4,240,072 | 2/9/2023 |
2.0.14 | 8,739,402 | 10/11/2022 |
2.0.13 | 966,869 | 9/27/2022 |
2.0.13-preview.1 | 267 | 9/26/2022 |
2.0.12 | 3,502,313 | 8/24/2022 |
2.0.11 | 1,830,637 | 8/11/2022 |
2.0.10 | 945,237 | 7/20/2022 |
2.0.9 | 5,099,589 | 6/9/2022 |
2.0.8 | 5,811,307 | 2/18/2022 |
2.0.7 | 3,852,602 | 12/16/2021 |
2.0.6 | 314,542 | 12/2/2021 |
2.0.5 | 6,859,302 | 9/1/2021 |
2.0.4 | 53,620 | 8/24/2021 |
2.0.3 | 400,641 | 8/17/2021 |
2.0.2 | 696,038 | 8/11/2021 |
2.0.1 | 177,958 | 8/5/2021 |
2.0.0 | 557,085 | 7/22/2021 |
2.0.0-preview.14 | 2,491 | 7/7/2021 |
2.0.0-preview.13 | 46,681 | 6/18/2021 |
2.0.0-preview.12 | 43,718 | 6/7/2021 |
2.0.0-preview.11 | 61,630 | 5/7/2021 |
2.0.0-preview.10 | 45,136 | 4/21/2021 |
2.0.0-preview.9 | 25,139 | 4/1/2021 |
2.0.0-preview.8 | 40,108 | 3/17/2021 |
2.0.0-preview.7 | 614 | 3/2/2021 |
2.0.0-preview.6 | 474 | 2/24/2021 |
2.0.0-preview.5 | 352 | 2/24/2021 |
2.0.0-preview.4 | 5,145 | 1/6/2021 |
2.0.0-preview.3 | 29,066 | 4/29/2020 |
2.0.0-preview.2 | 2,544 | 4/9/2020 |
2.0.0-preview.1 | 16,515 | 3/9/2020 |
1.25.1 | 11,687,269 | 3/25/2021 |
1.25.1-preview.2 | 337 | 3/25/2021 |
1.25.1-preview.1 | 357 | 3/25/2021 |
1.25.0 | 283,835 | 3/25/2021 |
1.25.0-preview.2 | 371 | 3/20/2021 |
1.25.0-preview.1 | 572 | 3/17/2021 |
1.24.0 | 3,426,804 | 1/19/2021 |
1.24.0-preview.1 | 362 | 1/14/2021 |
1.23.0 | 3,001,193 | 11/26/2020 |
1.22.0 | 3,505,100 | 10/7/2020 |
1.22.0-preview.2 | 448 | 10/6/2020 |
1.22.0-preview.1 | 453 | 7/28/2020 |
1.21.0 | 3,459,171 | 7/28/2020 |
1.21.0-preview.1 | 3,104 | 6/19/2020 |
1.20.1 | 5,584,541 | 3/31/2020 |
1.20.0 | 7,532,352 | 2/5/2020 |
1.19.0 | 2,881,891 | 12/11/2019 |
1.18.0 | 1,421,785 | 10/10/2019 |
1.17.0 | 936,355 | 8/15/2019 |
1.16.0 | 128,391 | 7/3/2019 |
1.15.0 | 2,271,815 | 5/1/2019 |
1.14.1 | 163,768 | 3/29/2019 |
1.14.0 | 1,386,544 | 3/25/2019 |
1.12.0 | 1,386,649 | 10/31/2018 |
1.11.0 | 317,771 | 9/19/2018 |
1.10.0 | 423,372 | 7/6/2018 |
1.9.0 | 1,680,014 | 5/3/2018 |
1.8.1 | 221,058 | 3/23/2018 |
1.7.0 | 202,439 | 12/14/2017 |
1.6.2 | 170,610 | 9/26/2017 |
1.6.1 | 83,899 | 8/24/2017 |
1.6.0 | 51,522 | 8/8/2017 |
1.5.0 | 257,508 | 6/12/2017 |
1.4.0 | 308,888 | 5/10/2017 |
1.3.1 | 73,538 | 4/3/2017 |
1.3.0 | 211,700 | 11/8/2016 |
1.2.1 | 146,207 | 9/27/2016 |
1.1.1 | 12,300 | 8/8/2016 |
1.1.0 | 5,198 | 8/6/2016 |