Microsoft.Graph.Core 3.0.5
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 core client library targets .NetStandard 1.1 and .Net Framework 4.5.
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
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.
Showing the top 20 packages that depend on Microsoft.Graph.Core.
Packages | 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.
|
4 |
Microsoft.Graph
Microsoft Graph Client Library allows you to call Office 365, Azure AD and other Microsoft services through a single unified developer experience.
|
5 |
Microsoft.Graph
Microsoft Graph Client Library allows you to call Office 365, Azure AD and other Microsoft services through a single unified developer experience.
|
6 |
Microsoft.Graph
Microsoft Graph Client Library allows you to call Office 365, Azure AD and other Microsoft services through a single unified developer experience.
|
7 |
Microsoft.Graph
This package includes the client libraries for connecting your app to the Microsoft Graph. Microsoft Graph enables your app to interact with data entities and their relationships from many Microsoft cloud services with a unified developer experience. Learn more about Microsoft Graph at http://graph.microsoft.io.
|
5 |
.NET Framework 4.6.2
- Microsoft.IdentityModel.Protocols.OpenIdConnect (>= 6.27.0)
- System.Security.Claims (>= 4.3.0)
- NETStandard.Library (>= 2.0.3)
- Microsoft.Kiota.Serialization.Text (>= 1.0.1)
- Microsoft.Kiota.Serialization.Json (>= 1.0.3)
- Microsoft.Kiota.Serialization.Form (>= 1.0.1)
- Microsoft.Kiota.Http.HttpClientLibrary (>= 1.0.1)
- Microsoft.Kiota.Authentication.Azure (>= 1.0.2)
- Microsoft.Kiota.Abstractions (>= 1.1.0)
- System.Net.Http.WinHttpHandler (>= 7.0.0)
.NET 6.0
- NETStandard.Library (>= 2.0.3)
- Microsoft.Kiota.Serialization.Text (>= 1.0.1)
- Microsoft.Kiota.Serialization.Json (>= 1.0.3)
- Microsoft.Kiota.Serialization.Form (>= 1.0.1)
- Microsoft.Kiota.Http.HttpClientLibrary (>= 1.0.1)
- Microsoft.Kiota.Authentication.Azure (>= 1.0.2)
- Microsoft.Kiota.Abstractions (>= 1.1.0)
- Microsoft.IdentityModel.Protocols.OpenIdConnect (>= 6.27.0)
- System.Runtime.InteropServices.NFloat.Internal (>= 6.0.1)
- System.Security.Claims (>= 4.3.0)
.NET 6.0
- System.Security.Claims (>= 4.3.0)
- System.Runtime.InteropServices.NFloat.Internal (>= 6.0.1)
- NETStandard.Library (>= 2.0.3)
- Microsoft.Kiota.Serialization.Text (>= 1.0.1)
- Microsoft.Kiota.Serialization.Json (>= 1.0.3)
- Microsoft.Kiota.Serialization.Form (>= 1.0.1)
- Microsoft.Kiota.Authentication.Azure (>= 1.0.2)
- Microsoft.Kiota.Abstractions (>= 1.1.0)
- Microsoft.IdentityModel.Protocols.OpenIdConnect (>= 6.27.0)
- Microsoft.Kiota.Http.HttpClientLibrary (>= 1.0.1)
.NET 6.0
- Microsoft.Kiota.Abstractions (>= 1.1.0)
- System.Security.Claims (>= 4.3.0)
- NETStandard.Library (>= 2.0.3)
- Microsoft.Kiota.Serialization.Text (>= 1.0.1)
- Microsoft.Kiota.Serialization.Json (>= 1.0.3)
- Microsoft.Kiota.Serialization.Form (>= 1.0.1)
- Microsoft.Kiota.Http.HttpClientLibrary (>= 1.0.1)
- Microsoft.Kiota.Authentication.Azure (>= 1.0.2)
- Microsoft.IdentityModel.Protocols.OpenIdConnect (>= 6.27.0)
.NET Standard 2.0
- System.Security.Claims (>= 4.3.0)
- Microsoft.Kiota.Serialization.Text (>= 1.0.1)
- Microsoft.Kiota.Serialization.Json (>= 1.0.3)
- Microsoft.Kiota.Serialization.Form (>= 1.0.1)
- Microsoft.Kiota.Http.HttpClientLibrary (>= 1.0.1)
- Microsoft.Kiota.Authentication.Azure (>= 1.0.2)
- Microsoft.Kiota.Abstractions (>= 1.1.0)
- Microsoft.IdentityModel.Protocols.OpenIdConnect (>= 6.27.0)
.NET 6.0
- System.Runtime.InteropServices.NFloat.Internal (>= 6.0.1)
- System.Security.Claims (>= 4.3.0)
- NETStandard.Library (>= 2.0.3)
- Microsoft.Kiota.Serialization.Text (>= 1.0.1)
- Microsoft.Kiota.Serialization.Json (>= 1.0.3)
- Microsoft.Kiota.Http.HttpClientLibrary (>= 1.0.1)
- Microsoft.Kiota.Authentication.Azure (>= 1.0.2)
- Microsoft.Kiota.Abstractions (>= 1.1.0)
- Microsoft.Kiota.Serialization.Form (>= 1.0.1)
- Microsoft.IdentityModel.Protocols.OpenIdConnect (>= 6.27.0)
.NET 6.0
- Microsoft.Kiota.Serialization.Text (>= 1.0.1)
- Microsoft.Kiota.Serialization.Form (>= 1.0.1)
- Microsoft.Kiota.Http.HttpClientLibrary (>= 1.0.1)
- Microsoft.Kiota.Authentication.Azure (>= 1.0.2)
- Microsoft.Kiota.Abstractions (>= 1.1.0)
- Microsoft.IdentityModel.Protocols.OpenIdConnect (>= 6.27.0)
- NETStandard.Library (>= 2.0.3)
- System.Security.Claims (>= 4.3.0)
- Microsoft.Kiota.Serialization.Json (>= 1.0.3)
.NET 6.0
- Microsoft.Kiota.Abstractions (>= 1.1.0)
- Microsoft.IdentityModel.Protocols.OpenIdConnect (>= 6.27.0)
- System.Security.Claims (>= 4.3.0)
- NETStandard.Library (>= 2.0.3)
- Microsoft.Kiota.Serialization.Text (>= 1.0.1)
- Microsoft.Kiota.Serialization.Json (>= 1.0.3)
- Microsoft.Kiota.Serialization.Form (>= 1.0.1)
- Microsoft.Kiota.Http.HttpClientLibrary (>= 1.0.1)
- Microsoft.Kiota.Authentication.Azure (>= 1.0.2)
Version | Downloads | Last updated |
---|---|---|
3.2.0 | 1 | 11/13/2024 |
3.1.22 | 0 | 09/26/2024 |
3.1.21 | 0 | 09/04/2024 |
3.1.20 | 0 | 08/28/2024 |
3.1.19 | 0 | 08/26/2024 |
3.1.18 | 0 | 08/26/2024 |
3.1.17 | 0 | 08/19/2024 |
3.1.16 | 0 | 08/15/2024 |
3.1.15 | 0 | 08/09/2024 |
3.1.14 | 0 | 07/24/2024 |
3.1.13 | 0 | 07/03/2024 |
3.1.12 | 0 | 05/28/2024 |
3.1.11 | 3 | 05/24/2024 |
3.1.10 | 5 | 05/24/2024 |
3.1.9 | 3 | 05/24/2024 |
3.1.8 | 4 | 05/24/2024 |
3.1.8-preview.1 | 5 | 05/24/2024 |
3.1.7 | 2 | 05/24/2024 |
3.1.6 | 2 | 05/24/2024 |
3.1.5 | 4 | 05/24/2024 |
3.1.4 | 3 | 05/24/2024 |
3.1.3 | 2 | 05/24/2024 |
3.1.2 | 0 | 11/15/2023 |
3.1.1 | 3 | 05/24/2024 |
3.1.0 | 2 | 05/24/2024 |
3.0.11 | 2 | 05/24/2024 |
3.0.11-preview.1 | 3 | 05/24/2024 |
3.0.10 | 5 | 05/24/2024 |
3.0.10-preview.1 | 3 | 05/24/2024 |
3.0.9 | 2 | 05/24/2024 |
3.0.9-preview.1 | 2 | 05/24/2024 |
3.0.8 | 2 | 05/24/2024 |
3.0.7 | 3 | 05/24/2024 |
3.0.6 | 0 | 04/18/2023 |
3.0.6-preview.1 | 1 | 05/24/2024 |
3.0.5 | 6 | 05/24/2024 |
3.0.4 | 2 | 05/24/2024 |
3.0.3 | 3 | 05/24/2024 |
3.0.2 | 2 | 05/24/2024 |
3.0.1 | 5 | 05/24/2024 |
3.0.0 | 2 | 05/24/2024 |
3.0.0-rc.6 | 4 | 05/24/2024 |
3.0.0-rc.5 | 3 | 05/24/2024 |
3.0.0-rc.4 | 1 | 05/24/2024 |
3.0.0-rc.3 | 4 | 05/24/2024 |
3.0.0-rc.2 | 3 | 05/24/2024 |
3.0.0-rc.1 | 5 | 05/24/2024 |
3.0.0-preview.19 | 1 | 05/24/2024 |
3.0.0-preview.18 | 0 | 12/06/2022 |
3.0.0-preview.17 | 3 | 05/24/2024 |
3.0.0-preview.16 | 2 | 05/24/2024 |
3.0.0-preview.15 | 6 | 05/24/2024 |
3.0.0-preview.14 | 5 | 05/24/2024 |
3.0.0-preview.13 | 4 | 05/24/2024 |
3.0.0-preview.12 | 4 | 05/24/2024 |
3.0.0-preview.11 | 2 | 05/24/2024 |
3.0.0-preview.10 | 3 | 05/24/2024 |
3.0.0-preview.9 | 2 | 05/24/2024 |
3.0.0-preview.8 | 1 | 05/24/2024 |
3.0.0-preview.7 | 2 | 05/24/2024 |
3.0.0-preview.6 | 3 | 05/24/2024 |
3.0.0-preview.5 | 1 | 05/24/2024 |
3.0.0-preview.4 | 3 | 05/24/2024 |
3.0.0-preview.3 | 3 | 05/24/2024 |
3.0.0-preview.2 | 3 | 05/24/2024 |
3.0.0-preview.1 | 2 | 05/24/2024 |
2.0.15 | 2 | 05/24/2024 |
2.0.14 | 3 | 05/24/2024 |
2.0.13 | 4 | 05/24/2024 |
2.0.13-preview.1 | 2 | 05/24/2024 |
2.0.12 | 2 | 05/24/2024 |
2.0.11 | 2 | 05/24/2024 |
2.0.10 | 2 | 05/24/2024 |
2.0.9 | 1 | 05/24/2024 |
2.0.8 | 1 | 05/24/2024 |
2.0.7 | 2 | 05/24/2024 |
2.0.6 | 2 | 05/24/2024 |
2.0.5 | 4 | 05/24/2024 |
2.0.4 | 2 | 05/24/2024 |
2.0.3 | 3 | 05/24/2024 |
2.0.2 | 2 | 05/24/2024 |
2.0.1 | 2 | 05/24/2024 |
2.0.0 | 2 | 05/24/2024 |
2.0.0-preview.14 | 5 | 05/24/2024 |
2.0.0-preview.13 | 4 | 05/24/2024 |
2.0.0-preview.12 | 2 | 05/24/2024 |
2.0.0-preview.11 | 2 | 05/24/2024 |
2.0.0-preview.10 | 4 | 05/24/2024 |
2.0.0-preview.9 | 3 | 05/24/2024 |
2.0.0-preview.8 | 2 | 05/24/2024 |
2.0.0-preview.7 | 2 | 05/24/2024 |
2.0.0-preview.6 | 1 | 05/24/2024 |
2.0.0-preview.5 | 3 | 05/24/2024 |
2.0.0-preview.4 | 1 | 05/24/2024 |
2.0.0-preview.3 | 3 | 05/24/2024 |
2.0.0-preview.2 | 2 | 05/24/2024 |
2.0.0-preview.1 | 3 | 05/24/2024 |
1.25.1 | 4 | 05/24/2024 |
1.25.1-preview.2 | 3 | 05/24/2024 |
1.25.1-preview.1 | 4 | 05/24/2024 |
1.25.0 | 1 | 05/24/2024 |
1.25.0-preview.2 | 1 | 05/24/2024 |
1.25.0-preview.1 | 1 | 05/24/2024 |
1.24.0 | 1 | 05/24/2024 |
1.24.0-preview.1 | 3 | 05/24/2024 |
1.23.0 | 1 | 05/24/2024 |
1.22.0 | 2 | 05/24/2024 |
1.22.0-preview.2 | 2 | 05/24/2024 |
1.22.0-preview.1 | 0 | 07/28/2020 |
1.21.0 | 0 | 07/28/2020 |
1.21.0-preview.1 | 2 | 05/24/2024 |
1.20.1 | 2 | 05/24/2024 |
1.20.0 | 2 | 05/24/2024 |
1.19.0 | 3 | 05/24/2024 |
1.18.0 | 4 | 05/24/2024 |
1.17.0 | 4 | 05/24/2024 |
1.16.0 | 6 | 05/24/2024 |
1.15.0 | 3 | 05/24/2024 |
1.14.1 | 3 | 05/24/2024 |
1.14.0 | 1 | 05/24/2024 |
1.12.0 | 4 | 05/24/2024 |
1.11.0 | 5 | 05/24/2024 |
1.10.0 | 3 | 05/24/2024 |
1.9.0 | 2 | 05/24/2024 |
1.8.1 | 4 | 05/24/2024 |
1.7.0 | 2 | 05/24/2024 |
1.6.2 | 2 | 05/24/2024 |
1.6.1 | 2 | 05/24/2024 |
1.6.0 | 3 | 05/24/2024 |
1.5.0 | 4 | 05/24/2024 |
1.4.0 | 4 | 05/24/2024 |
1.3.1 | 2 | 05/24/2024 |
1.3.0 | 3 | 05/24/2024 |
1.2.1 | 1 | 05/24/2024 |
1.1.1 | 3 | 05/24/2024 |
1.1.0 | 3 | 05/24/2024 |