Microsoft.Graph 5.44.0

The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org. Prefix Reserved
dotnet add package Microsoft.Graph --version 5.44.0
NuGet\Install-Package Microsoft.Graph -Version 5.44.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Microsoft.Graph" Version="5.44.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Microsoft.Graph --version 5.44.0
#r "nuget: Microsoft.Graph, 5.44.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Microsoft.Graph as a Cake Addin
#addin nuget:?package=Microsoft.Graph&version=5.44.0

// Install Microsoft.Graph as a Cake Tool
#tool nuget:?package=Microsoft.Graph&version=5.44.0

Microsoft Graph .NET Client Library

Validate Pull Request NuGet Version

Integrate the Microsoft Graph API into your .NET project!

The Microsoft Graph .NET Client Library targets .NetStandard 2.0.

Installation via NuGet

To install the client library via NuGet:

  • Search for Microsoft.Graph in the NuGet Library, or
  • Type Install-Package Microsoft.Graph into the Package Manager Console.

Getting started

1. Register your application

Register your application to use Microsoft Graph API using the Microsoft Application Registration Portal.

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 Microsoft Graph client object with an authentication provider

An instance of the GraphServiceClient class handles building requests, sending them to Microsoft Graph API, and processing the responses. To create a new instance of this class, you need to provide an instance of IAuthenticationProvider which can authenticate requests to Microsoft Graph.

For more information on initializing a client instance, see the library overview

4. Make requests to the graph

Once you have completed authentication and have a GraphServiceClient, you can begin to make calls to the service. The requests in the SDK follow the format of the Microsoft Graph API's RESTful syntax.

For example, to retrieve a user's default drive:

var drive = await graphClient.Me.Drive.GetAsync();

GetAsync will return a Drive object on success and throw a ApiException on error.

To get the current user's root folder of their default drive:

// Get the user's driveId
var drive = await graphClient.Me.Drive.GetAsync();
var userDriveId = driveItem.Id;
// use the driveId to get the root drive
var rootItem = await graphClient.Drives[userDriveId].Root.GetAsync();

GetAsync will return a DriveItem object on success and throw a ApiException on error.

For a general overview of how the SDK is designed, see overview.

The following sample applications are also available:

Documentation and resources

Notes

Upgrading from v1

Between 1.x and 3.x there were some minor possibly breaking changes:

  • .NET Standard minimum version bumped from netStandard1.3 to netstandard2.0
  • .NET Framework minimum version bumped from net45 to net461
  • a change in enum order for GiphyRatingType
  • ParticipantInfo became InvitationParticipantInfo
  • CallRecordRequestBody became CallRecordResponseRequestBody

Upgrading to v4

Between 3.x and 4.x there were some major breaking changes:

  • .NET Standard minimum version bumped from netStandard1.3 to netstandard2.0
  • .NET Framework minimum version bumped from net45 to net462
  • Replacing Newtosoft.Json with System.Text.Json
  • Upgrading Microsoft.Graph.Core dependency to version 2.0.0

View the upgrade guide here.

Upgrading to v5

Between 4.x and 5.x there were several major breaking changes as the SDK now uses Kiota for code generation.

View the upgrade guide here.

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

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 and msbuild from CLI or run Build from Visual Studio to restore Nuget packages and build the project

Due to long file names you may need to run git config --system core.longpaths true before cloning the repo to your system.

Additionally for Windows OS, set the value of the parameter HKLM\SYSTEM\CurrentControlSet\Control\FileSystem LongPathsEnabled to 1, before opening the solution in VS

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 Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 was computed.  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 is compatible. 
.NET Framework net461 was computed.  net462 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (179)

Showing the top 5 NuGet packages that depend on Microsoft.Graph:

Package Downloads
Microsoft.Identity.Web.MicrosoftGraph The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

This package enables ASP.NET Core web apps and web APIs to use the Microsoft identity platform (formerly Azure AD v2.0). This package is specifically used for web applications, which sign-in users and call Microsoft Graph, and for protected web APIs that call Microsoft Graph.

GSF.Security

Library of core security framework for implementing role-based security with integrated Active Directory, local account and database style authentication across various .NET application types.

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.

SharePointPnPCoreOnline

Retired - please use PnP Framework (https://github.com/pnp/pnpframework) going forward. Core CSOM extension methods for SharePoint Online add-in model development. This will increase productivity of the developers by abstracting complex operations.

GSF.Web

Library of ASP.NET web forms extensions, embedded resource hosting and HTTP Module for implementing role-based security.

GitHub repositories (50)

Showing the top 5 popular GitHub repositories that depend on Microsoft.Graph:

Repository Stars
microsoft/semantic-kernel
Integrate cutting-edge LLM technology quickly and easily into your apps
unoplatform/uno
Build Mobile, Desktop and WebAssembly apps with C# and XAML. Today. Open source and professionally supported.
Azure/azure-sdk-for-net
This repository is for active development of the Azure SDK for .NET. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/dotnet/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-net.
lukencode/FluentEmail
All in one email sender for .NET. Supports popular senders (SendGrid, MailGun, etc) and Razor templates.
microsoft/onefuzz
A self-hosted Fuzzing-As-A-Service platform
Version Downloads Last updated
5.44.0 116,956 2/28/2024
5.43.0 90,029 2/21/2024
5.42.0 82,540 2/14/2024
5.41.0 180,299 2/1/2024
5.40.0 158,596 1/24/2024
5.39.0 138,463 1/17/2024
5.38.0 262,920 1/4/2024
5.37.0 220,230 12/14/2023
5.36.0 407,894 11/22/2023
5.35.0 171,048 11/16/2023
5.34.0 159,133 11/8/2023
5.33.0 128,869 11/3/2023
5.32.0 171,852 10/26/2023
5.31.0 159,874 10/19/2023
5.30.0 113,010 10/12/2023
5.29.0 93,533 10/6/2023
5.28.0 298,194 9/21/2023
5.27.0 127,728 9/14/2023
5.26.0 141,681 9/6/2023
5.25.0 124,586 8/31/2023
5.24.0 203,134 8/24/2023
5.23.0 98,634 8/18/2023
5.22.0 228,003 8/10/2023
5.21.0 176,836 8/2/2023
5.20.0 92,590 7/27/2023
5.19.0 154,771 7/19/2023
5.18.0 155,155 7/12/2023
5.17.0 178,364 7/5/2023
5.16.0 125,174 6/29/2023
5.15.0 201,178 6/21/2023
5.14.0 144,732 6/15/2023
5.13.0 183,256 6/9/2023
5.12.0 449,991 5/25/2023
5.11.0 184,834 5/17/2023
5.10.0 170,782 5/11/2023
5.9.0 128,509 5/4/2023
5.8.0 112,948 4/28/2023
5.7.0 148,166 4/20/2023
5.6.0 172,611 4/13/2023
5.5.0 326,661 4/6/2023
5.4.0 155,658 3/29/2023
5.3.0 176,907 3/22/2023
5.2.0 162,191 3/15/2023
5.1.0 123,326 3/8/2023
5.0.0 155,063 2/28/2023
5.0.0-rc.5 7,904 2/9/2023
5.0.0-rc.4 3,179 1/27/2023
5.0.0-rc.3 2,125 1/18/2023
5.0.0-rc.2 1,210 1/11/2023
5.0.0-rc.1 4,260 12/16/2022
5.0.0-preview.14 63,786 11/23/2022
5.0.0-preview.13 34,519 10/19/2022
5.0.0-preview.12 3,053 9/28/2022
5.0.0-preview.11 1,501 9/14/2022
5.0.0-preview.10 59,445 7/20/2022
5.0.0-preview.9 2,238 7/13/2022
5.0.0-preview.8 19,979 6/21/2022
5.0.0-preview.7 939 6/9/2022
5.0.0-preview.6 595 6/2/2022
5.0.0-preview.5 4,692 5/20/2022
5.0.0-preview.4 4,408 5/6/2022
5.0.0-preview.3 3,263 4/20/2022
5.0.0-preview.2 906 4/5/2022
5.0.0-preview.1 1,232 3/24/2022
4.54.0 2,281,477 2/16/2023
4.53.0 704,345 2/8/2023
4.52.0 821,280 1/25/2023
4.51.0 699,292 1/17/2023
4.50.0 469,108 1/5/2023
4.49.0 708,700 12/15/2022
4.48.0 1,033,349 11/23/2022
4.47.0 869,717 11/9/2022
4.46.0 525,931 11/2/2022
4.45.0 824,851 10/19/2022
4.44.0 309,202 10/12/2022
4.43.0 256,661 10/5/2022
4.42.0 428,470 9/28/2022
4.41.0 366,169 9/22/2022
4.40.0 347,201 9/14/2022
4.39.0 1,241,009 9/6/2022
4.38.0 308,473 8/31/2022
4.37.0 336,179 8/25/2022
4.36.0 740,931 8/12/2022
4.35.0 739,813 7/21/2022
4.34.0 3,047,707 7/6/2022
4.33.0 518,291 6/29/2022
4.32.0 371,003 6/21/2022
4.31.0 188,276 6/16/2022
4.30.0 347,777 6/8/2022
4.29.0 1,020,809 5/18/2022
4.28.0 387,115 5/11/2022
4.27.0 273,549 5/4/2022
4.26.0 110,826 4/29/2022
4.25.0 777,040 4/13/2022
4.24.0 302,281 4/5/2022
4.23.0 131,237 3/30/2022
4.22.0 350,274 3/22/2022
4.21.0 301,621 3/16/2022
4.20.0 203,029 3/9/2022
4.19.0 490,458 2/24/2022
4.18.0 518,674 2/10/2022
4.17.0 919,136 1/27/2022
4.16.0 274,042 1/19/2022
4.15.0 335,894 1/13/2022
4.14.0 827,183 1/5/2022
4.13.0 485,383 12/22/2021
4.12.0 243,489 12/15/2021
4.11.0 2,046,323 11/25/2021
4.10.0 575,550 11/11/2021
4.9.0 487,194 11/3/2021
4.8.0 149,666 10/28/2021
4.7.0 580,188 10/14/2021
4.6.0 1,108,804 9/23/2021
4.5.0 558,888 9/9/2021
4.4.0 255,501 9/2/2021
4.3.0 292,994 8/19/2021
4.2.0 471,790 8/12/2021
4.1.0 150,441 8/5/2021
4.0.0 469,225 7/23/2021
4.0.0-preview.7 15,078 6/18/2021
4.0.0-preview.6 14,358 6/7/2021
4.0.0-preview.5 7,629 5/21/2021
4.0.0-preview.4 14,673 5/7/2021
4.0.0-preview.3 9,166 4/22/2021
4.0.0-preview.2 10,909 4/1/2021
4.0.0-preview.1 21,876 3/17/2021
3.35.0 3,823,738 6/15/2021
3.34.0 265,638 6/10/2021
3.33.0 1,965,419 5/20/2021
3.32.0 364,580 5/12/2021
3.31.0 210,857 5/7/2021
3.30.0 671,149 4/20/2021
3.29.0 547,071 4/2/2021
3.28.0 254,036 3/25/2021
3.27.0 868,848 3/10/2021
3.26.0 299,532 3/4/2021
3.25.0 418,020 2/18/2021
3.24.0 429,535 2/10/2021
3.23.0 472,662 1/29/2021
3.22.0 472,659 1/20/2021
3.21.0 1,163,839 12/8/2020
3.20.0 1,034,386 11/19/2020
3.19.0 1,143,673 10/27/2020
3.18.0 522,140 10/14/2020
3.17.0 209,310 10/10/2020
3.16.0 222,616 10/7/2020
3.15.0 543,749 9/24/2020
3.14.0 210,559 9/15/2020
3.13.0 130,233 9/10/2020
3.12.0 794,526 8/26/2020
3.11.0 15,567 8/25/2020
3.10.0 141,592 8/18/2020
3.9.0 603,200 7/28/2020
3.8.0 1,081,037 6/16/2020
3.7.0 181,462 6/9/2020
3.6.0 627,970 5/21/2020
3.5.0 319,769 5/12/2020
3.4.0 210,243 5/1/2020
3.3.0 371,874 4/14/2020
3.2.0 118,142 4/7/2020
3.1.0 203,421 4/1/2020
3.0.1 349,282 3/18/2020
1.21.0 6,847,377 12/11/2019
1.20.0 675,263 11/6/2019
1.19.0 147,577 10/29/2019
1.18.0 283,373 10/15/2019
1.17.0 797,541 8/15/2019
1.16.0 660,712 7/2/2019
1.15.0 1,170,534 5/1/2019
1.14.0 1,303,198 3/25/2019
1.14.0-preview 20,963 2/25/2019
1.13.0-preview 26,976 12/18/2018
1.12.0 1,318,293 10/31/2018
1.11.0 300,272 9/19/2018
1.10.0 397,763 7/6/2018
1.9.0 1,452,331 5/3/2018
1.8.1 214,378 3/26/2018
1.7.0 187,114 12/14/2017
1.6.2 154,629 10/6/2017
1.6.1 2,819 10/5/2017
1.6.0 11,492 9/26/2017
1.5.1 71,730 8/24/2017
1.5.0 46,944 8/8/2017
1.4.0 244,797 6/12/2017
1.3.0 179,648 5/10/2017
1.2.1 100,973 2/13/2017
1.2.0 119,505 11/8/2016
1.1.1 113,125 9/27/2016
1.0.1 195,237 4/21/2016
1.0.0 9,879 3/30/2016
0.2.8-rc 10,901 6/24/2015