Microsoft.Graph.Core 3.0.0-rc.1
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.
|
8 |
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
Microsoft Graph Client Library allows you to call Office 365, Azure AD and other Microsoft services through a single unified developer experience.
|
6 |
.NET Framework 4.6.2
- Microsoft.IdentityModel.Protocols.OpenIdConnect (>= 6.25.1)
- Microsoft.Kiota.Abstractions (>= 1.0.0-rc.1)
- Microsoft.Kiota.Authentication.Azure (>= 1.0.0-rc.1)
- Microsoft.Kiota.Http.HttpClientLibrary (>= 1.0.0-rc.1)
- Microsoft.Kiota.Serialization.Form (>= 1.0.0-rc.1)
- Microsoft.Kiota.Serialization.Json (>= 1.0.0-rc.1)
- Microsoft.Kiota.Serialization.Text (>= 1.0.0-rc.1)
- NETStandard.Library (>= 2.0.3)
- System.Net.Http.WinHttpHandler (>= 7.0.0)
- System.Security.Claims (>= 4.3.0)
.NET 6.0
- Microsoft.IdentityModel.Protocols.OpenIdConnect (>= 6.25.1)
- Microsoft.Kiota.Abstractions (>= 1.0.0-rc.1)
- Microsoft.Kiota.Authentication.Azure (>= 1.0.0-rc.1)
- Microsoft.Kiota.Http.HttpClientLibrary (>= 1.0.0-rc.1)
- Microsoft.Kiota.Serialization.Form (>= 1.0.0-rc.1)
- Microsoft.Kiota.Serialization.Json (>= 1.0.0-rc.1)
- Microsoft.Kiota.Serialization.Text (>= 1.0.0-rc.1)
- NETStandard.Library (>= 2.0.3)
- System.Security.Claims (>= 4.3.0)
.NET 6.0
- Microsoft.IdentityModel.Protocols.OpenIdConnect (>= 6.25.1)
- Microsoft.Kiota.Abstractions (>= 1.0.0-rc.1)
- Microsoft.Kiota.Authentication.Azure (>= 1.0.0-rc.1)
- Microsoft.Kiota.Http.HttpClientLibrary (>= 1.0.0-rc.1)
- Microsoft.Kiota.Serialization.Form (>= 1.0.0-rc.1)
- Microsoft.Kiota.Serialization.Json (>= 1.0.0-rc.1)
- Microsoft.Kiota.Serialization.Text (>= 1.0.0-rc.1)
- NETStandard.Library (>= 2.0.3)
- System.Security.Claims (>= 4.3.0)
.NET 6.0
- Microsoft.IdentityModel.Protocols.OpenIdConnect (>= 6.25.1)
- Microsoft.Kiota.Abstractions (>= 1.0.0-rc.1)
- Microsoft.Kiota.Authentication.Azure (>= 1.0.0-rc.1)
- Microsoft.Kiota.Http.HttpClientLibrary (>= 1.0.0-rc.1)
- Microsoft.Kiota.Serialization.Form (>= 1.0.0-rc.1)
- Microsoft.Kiota.Serialization.Json (>= 1.0.0-rc.1)
- Microsoft.Kiota.Serialization.Text (>= 1.0.0-rc.1)
- NETStandard.Library (>= 2.0.3)
- System.Runtime.InteropServices.NFloat.Internal (>= 6.0.1)
- System.Security.Claims (>= 4.3.0)
.NET 6.0
- Microsoft.IdentityModel.Protocols.OpenIdConnect (>= 6.25.1)
- Microsoft.Kiota.Abstractions (>= 1.0.0-rc.1)
- Microsoft.Kiota.Authentication.Azure (>= 1.0.0-rc.1)
- Microsoft.Kiota.Http.HttpClientLibrary (>= 1.0.0-rc.1)
- Microsoft.Kiota.Serialization.Form (>= 1.0.0-rc.1)
- Microsoft.Kiota.Serialization.Json (>= 1.0.0-rc.1)
- Microsoft.Kiota.Serialization.Text (>= 1.0.0-rc.1)
- NETStandard.Library (>= 2.0.3)
- System.Runtime.InteropServices.NFloat.Internal (>= 6.0.1)
- System.Security.Claims (>= 4.3.0)
.NET 6.0
- Microsoft.IdentityModel.Protocols.OpenIdConnect (>= 6.25.1)
- Microsoft.Kiota.Abstractions (>= 1.0.0-rc.1)
- Microsoft.Kiota.Authentication.Azure (>= 1.0.0-rc.1)
- Microsoft.Kiota.Http.HttpClientLibrary (>= 1.0.0-rc.1)
- Microsoft.Kiota.Serialization.Form (>= 1.0.0-rc.1)
- Microsoft.Kiota.Serialization.Json (>= 1.0.0-rc.1)
- Microsoft.Kiota.Serialization.Text (>= 1.0.0-rc.1)
- NETStandard.Library (>= 2.0.3)
- System.Runtime.InteropServices.NFloat.Internal (>= 6.0.1)
- System.Security.Claims (>= 4.3.0)
.NET 6.0
- Microsoft.IdentityModel.Protocols.OpenIdConnect (>= 6.25.1)
- Microsoft.Kiota.Abstractions (>= 1.0.0-rc.1)
- Microsoft.Kiota.Authentication.Azure (>= 1.0.0-rc.1)
- Microsoft.Kiota.Http.HttpClientLibrary (>= 1.0.0-rc.1)
- Microsoft.Kiota.Serialization.Form (>= 1.0.0-rc.1)
- Microsoft.Kiota.Serialization.Json (>= 1.0.0-rc.1)
- Microsoft.Kiota.Serialization.Text (>= 1.0.0-rc.1)
- NETStandard.Library (>= 2.0.3)
- System.Security.Claims (>= 4.3.0)
.NET Standard 2.0
- Microsoft.IdentityModel.Protocols.OpenIdConnect (>= 6.25.1)
- Microsoft.Kiota.Abstractions (>= 1.0.0-rc.1)
- Microsoft.Kiota.Authentication.Azure (>= 1.0.0-rc.1)
- Microsoft.Kiota.Http.HttpClientLibrary (>= 1.0.0-rc.1)
- Microsoft.Kiota.Serialization.Form (>= 1.0.0-rc.1)
- Microsoft.Kiota.Serialization.Json (>= 1.0.0-rc.1)
- Microsoft.Kiota.Serialization.Text (>= 1.0.0-rc.1)
- System.Security.Claims (>= 4.3.0)
Version | Downloads | Last updated |
---|---|---|
3.2.0 | 0 | 11/08/2024 |
3.1.22 | 3 | 10/06/2024 |
3.1.21 | 3 | 09/26/2024 |
3.1.20 | 4 | 09/30/2024 |
3.1.19 | 2 | 08/27/2024 |
3.1.18 | 5 | 08/27/2024 |
3.1.17 | 5 | 08/20/2024 |
3.1.16 | 4 | 08/17/2024 |
3.1.15 | 4 | 08/13/2024 |
3.1.14 | 4 | 07/29/2024 |
3.1.13 | 4 | 07/04/2024 |
3.1.12 | 4 | 06/01/2024 |
3.1.11 | 5 | 05/20/2024 |
3.1.10 | 7 | 03/30/2024 |
3.1.9 | 5 | 03/31/2024 |
3.1.8 | 5 | 04/29/2024 |
3.1.8-preview.1 | 7 | 04/29/2024 |
3.1.7 | 5 | 04/29/2024 |
3.1.6 | 5 | 04/29/2024 |
3.1.5 | 5 | 04/09/2024 |
3.1.4 | 6 | 04/29/2024 |
3.1.3 | 5 | 04/29/2024 |
3.1.2 | 6 | 04/29/2024 |
3.1.1 | 5 | 04/29/2024 |
3.1.0 | 4 | 05/27/2024 |
3.0.11 | 6 | 04/29/2024 |
3.0.11-preview.1 | 7 | 04/29/2024 |
3.0.10 | 7 | 04/29/2024 |
3.0.10-preview.1 | 5 | 04/29/2024 |
3.0.9 | 5 | 04/29/2024 |
3.0.9-preview.1 | 5 | 04/29/2024 |
3.0.8 | 4 | 04/29/2024 |
3.0.7 | 4 | 04/29/2024 |
3.0.6 | 5 | 04/29/2024 |
3.0.6-preview.1 | 5 | 04/29/2024 |
3.0.5 | 5 | 04/29/2024 |
3.0.4 | 7 | 04/29/2024 |
3.0.3 | 5 | 04/29/2024 |
3.0.2 | 7 | 04/29/2024 |
3.0.1 | 5 | 04/29/2024 |
3.0.0 | 8 | 04/29/2024 |
3.0.0-rc.6 | 5 | 04/29/2024 |
3.0.0-rc.5 | 6 | 04/29/2024 |
3.0.0-rc.4 | 6 | 04/29/2024 |
3.0.0-rc.3 | 5 | 04/29/2024 |
3.0.0-rc.2 | 6 | 04/29/2024 |
3.0.0-rc.1 | 6 | 04/29/2024 |
3.0.0-preview.19 | 4 | 04/29/2024 |
3.0.0-preview.18 | 4 | 04/29/2024 |
3.0.0-preview.17 | 6 | 04/29/2024 |
3.0.0-preview.16 | 6 | 04/29/2024 |
3.0.0-preview.15 | 6 | 04/29/2024 |
3.0.0-preview.14 | 6 | 04/29/2024 |
3.0.0-preview.13 | 6 | 04/04/2024 |
3.0.0-preview.12 | 4 | 04/29/2024 |
3.0.0-preview.11 | 5 | 04/29/2024 |
3.0.0-preview.10 | 7 | 04/29/2024 |
3.0.0-preview.9 | 6 | 04/10/2024 |
3.0.0-preview.8 | 4 | 04/29/2024 |
3.0.0-preview.7 | 6 | 04/29/2024 |
3.0.0-preview.6 | 7 | 04/19/2024 |
3.0.0-preview.5 | 5 | 04/29/2024 |
3.0.0-preview.4 | 6 | 04/29/2024 |
3.0.0-preview.3 | 6 | 04/29/2024 |
3.0.0-preview.2 | 6 | 04/29/2024 |
3.0.0-preview.1 | 8 | 04/29/2024 |
2.0.15 | 8 | 04/27/2024 |
2.0.14 | 5 | 04/29/2024 |
2.0.13 | 5 | 04/29/2024 |
2.0.13-preview.1 | 6 | 04/29/2024 |
2.0.12 | 4 | 04/29/2024 |
2.0.11 | 5 | 04/29/2024 |
2.0.10 | 5 | 04/29/2024 |
2.0.9 | 7 | 04/29/2024 |
2.0.8 | 4 | 04/29/2024 |
2.0.7 | 6 | 04/29/2024 |
2.0.6 | 6 | 04/29/2024 |
2.0.5 | 4 | 04/29/2024 |
2.0.4 | 5 | 04/29/2024 |
2.0.3 | 5 | 04/29/2024 |
2.0.2 | 6 | 04/29/2024 |
2.0.1 | 6 | 04/29/2024 |
2.0.0 | 6 | 04/29/2024 |
2.0.0-preview.14 | 5 | 04/29/2024 |
2.0.0-preview.13 | 6 | 04/29/2024 |
2.0.0-preview.12 | 4 | 04/29/2024 |
2.0.0-preview.11 | 7 | 04/29/2024 |
2.0.0-preview.10 | 7 | 04/29/2024 |
2.0.0-preview.9 | 6 | 04/29/2024 |
2.0.0-preview.8 | 8 | 04/29/2024 |
2.0.0-preview.7 | 5 | 04/29/2024 |
2.0.0-preview.6 | 8 | 04/29/2024 |
2.0.0-preview.5 | 6 | 04/29/2024 |
2.0.0-preview.4 | 4 | 04/29/2024 |
2.0.0-preview.3 | 6 | 04/29/2024 |
2.0.0-preview.2 | 5 | 04/29/2024 |
2.0.0-preview.1 | 6 | 04/29/2024 |
1.25.1 | 5 | 04/29/2024 |
1.25.1-preview.2 | 6 | 04/29/2024 |
1.25.1-preview.1 | 5 | 04/29/2024 |
1.25.0 | 5 | 04/29/2024 |
1.25.0-preview.2 | 5 | 04/29/2024 |
1.25.0-preview.1 | 7 | 04/29/2024 |
1.24.0 | 5 | 04/29/2024 |
1.24.0-preview.1 | 6 | 04/29/2024 |
1.23.0 | 6 | 04/29/2024 |
1.22.0 | 6 | 04/29/2024 |
1.22.0-preview.2 | 8 | 04/29/2024 |
1.22.0-preview.1 | 6 | 04/29/2024 |
1.21.0 | 6 | 04/29/2024 |
1.21.0-preview.1 | 6 | 04/29/2024 |
1.20.1 | 6 | 04/29/2024 |
1.20.0 | 6 | 04/29/2024 |
1.19.0 | 6 | 04/29/2024 |
1.18.0 | 6 | 04/29/2024 |
1.17.0 | 5 | 04/29/2024 |
1.16.0 | 6 | 04/29/2024 |
1.15.0 | 5 | 04/29/2024 |
1.14.1 | 5 | 04/29/2024 |
1.14.0 | 4 | 04/29/2024 |
1.12.0 | 4 | 04/29/2024 |
1.11.0 | 5 | 04/29/2024 |
1.10.0 | 4 | 05/28/2024 |
1.9.0 | 6 | 04/21/2024 |
1.8.1 | 5 | 04/29/2024 |
1.7.0 | 5 | 04/29/2024 |
1.6.2 | 6 | 04/29/2024 |
1.6.1 | 5 | 04/29/2024 |
1.6.0 | 4 | 04/29/2024 |
1.5.0 | 5 | 04/29/2024 |
1.4.0 | 7 | 04/29/2024 |
1.3.1 | 8 | 04/29/2024 |
1.3.0 | 6 | 04/29/2024 |
1.2.1 | 6 | 04/29/2024 |
1.1.1 | 7 | 03/29/2024 |
1.1.0 | 8 | 04/29/2024 |