Microsoft.Graph 1.6.1

The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org. Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Microsoft.Graph --version 1.6.1
NuGet\Install-Package Microsoft.Graph -Version 1.6.1
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="1.6.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Microsoft.Graph --version 1.6.1
#r "nuget: Microsoft.Graph, 1.6.1"
#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=1.6.1

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

Microsoft Graph .NET Client Library

Build status NuGet Version

Integrate the Microsoft Graph API into your .NET project!

The Microsoft Graph .NET 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 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 one of the following supported authentication portals:

2. Authenticate for the Microsoft Graph service

The Microsoft Graph .NET Client Library does not include any default authentication implementations. Instead, the user will want to authenticate with the library of their choice, or against the OAuth endpoint directly, and built-in DelegateAuthenticationProvider class to authenticate each request. For more information on DelegateAuthenticationProvider, see the library overview

The recommended library for authenticating against AAD is ADAL.

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.Request().GetAsync();

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

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

var rootItem = await graphClient.Me.Drive.Root.Request().GetAsync();

GetAsync will return a DriveItem object on success and throw a ServiceException 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

Install NewtonSoft.Json first if you want to use a version greater than NewtonSoft.Json 6.0.1. For example, you'll need to install NewtonSoft.Json 9.0.1 first if you want to use this to library while targeting .Net Core with standard1.0.

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.

Other resources

License

Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT license

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  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 netcoreapp1.0 was computed.  netcoreapp1.1 was computed.  netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard1.1 is compatible.  netstandard1.2 was computed.  netstandard1.3 was computed.  netstandard1.4 was computed.  netstandard1.5 was computed.  netstandard1.6 was computed.  netstandard2.0 was computed.  netstandard2.1 was computed. 
.NET Framework net45 is compatible.  net451 was computed.  net452 was computed.  net46 was computed.  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 tizen30 was computed.  tizen40 was computed.  tizen60 was computed. 
Universal Windows Platform uap was computed.  uap10.0 was computed. 
Windows Phone wpa81 was computed. 
Windows Store netcore was computed.  netcore45 was computed.  netcore451 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 (49)

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.
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
pnp/PnP
SharePoint / Office 365 Developer Patterns and Practices - Archived older solutions. Please see https://aka.ms/m365pnp for updated guidance
Version Downloads Last updated
5.46.0 1,092 3/27/2024
5.45.0 20,354 3/22/2024
5.44.0 216,250 2/28/2024
5.43.0 111,398 2/21/2024
5.42.0 100,471 2/14/2024
5.41.0 205,303 2/1/2024
5.40.0 182,595 1/24/2024
5.39.0 155,210 1/17/2024
5.38.0 285,192 1/4/2024
5.37.0 236,953 12/14/2023
5.36.0 437,290 11/22/2023
5.35.0 180,152 11/16/2023
5.34.0 166,565 11/8/2023
5.33.0 134,029 11/3/2023
5.32.0 178,488 10/26/2023
5.31.0 167,885 10/19/2023
5.30.0 116,893 10/12/2023
5.29.0 96,452 10/6/2023
5.28.0 309,834 9/21/2023
5.27.0 130,555 9/14/2023
5.26.0 144,934 9/6/2023
5.25.0 128,004 8/31/2023
5.24.0 209,010 8/24/2023
5.23.0 101,498 8/18/2023
5.22.0 231,967 8/10/2023
5.21.0 180,962 8/2/2023
5.20.0 94,791 7/27/2023
5.19.0 157,732 7/19/2023
5.18.0 159,283 7/12/2023
5.17.0 181,796 7/5/2023
5.16.0 128,372 6/29/2023
5.15.0 206,746 6/21/2023
5.14.0 147,795 6/15/2023
5.13.0 186,958 6/9/2023
5.12.0 460,487 5/25/2023
5.11.0 190,616 5/17/2023
5.10.0 174,501 5/11/2023
5.9.0 130,595 5/4/2023
5.8.0 114,652 4/28/2023
5.7.0 150,978 4/20/2023
5.6.0 177,289 4/13/2023
5.5.0 332,350 4/6/2023
5.4.0 157,888 3/29/2023
5.3.0 179,407 3/22/2023
5.2.0 164,781 3/15/2023
5.1.0 125,209 3/8/2023
5.0.0 160,645 2/28/2023
5.0.0-rc.5 7,981 2/9/2023
5.0.0-rc.4 3,206 1/27/2023
5.0.0-rc.3 2,135 1/18/2023
5.0.0-rc.2 1,216 1/11/2023
5.0.0-rc.1 4,387 12/16/2022
5.0.0-preview.14 63,828 11/23/2022
5.0.0-preview.13 34,586 10/19/2022
5.0.0-preview.12 3,067 9/28/2022
5.0.0-preview.11 1,504 9/14/2022
5.0.0-preview.10 59,686 7/20/2022
5.0.0-preview.9 2,241 7/13/2022
5.0.0-preview.8 19,997 6/21/2022
5.0.0-preview.7 942 6/9/2022
5.0.0-preview.6 596 6/2/2022
5.0.0-preview.5 4,693 5/20/2022
5.0.0-preview.4 4,411 5/6/2022
5.0.0-preview.3 3,264 4/20/2022
5.0.0-preview.2 907 4/5/2022
5.0.0-preview.1 1,248 3/24/2022
4.54.0 2,358,923 2/16/2023
4.53.0 719,559 2/8/2023
4.52.0 841,058 1/25/2023
4.51.0 714,971 1/17/2023
4.50.0 476,786 1/5/2023
4.49.0 719,737 12/15/2022
4.48.0 1,045,885 11/23/2022
4.47.0 887,172 11/9/2022
4.46.0 534,327 11/2/2022
4.45.0 837,221 10/19/2022
4.44.0 312,974 10/12/2022
4.43.0 260,222 10/5/2022
4.42.0 435,540 9/28/2022
4.41.0 370,226 9/22/2022
4.40.0 352,639 9/14/2022
4.39.0 1,262,043 9/6/2022
4.38.0 312,152 8/31/2022
4.37.0 341,472 8/25/2022
4.36.0 779,930 8/12/2022
4.35.0 749,141 7/21/2022
4.34.0 3,110,086 7/6/2022
4.33.0 525,343 6/29/2022
4.32.0 377,316 6/21/2022
4.31.0 190,425 6/16/2022
4.30.0 351,783 6/8/2022
4.29.0 1,030,522 5/18/2022
4.28.0 391,915 5/11/2022
4.27.0 275,999 5/4/2022
4.26.0 112,051 4/29/2022
4.25.0 790,714 4/13/2022
4.24.0 304,402 4/5/2022
4.23.0 132,812 3/30/2022
4.22.0 353,823 3/22/2022
4.21.0 303,916 3/16/2022
4.20.0 204,742 3/9/2022
4.19.0 497,033 2/24/2022
4.18.0 524,590 2/10/2022
4.17.0 924,904 1/27/2022
4.16.0 275,796 1/19/2022
4.15.0 340,080 1/13/2022
4.14.0 831,316 1/5/2022
4.13.0 490,333 12/22/2021
4.12.0 244,799 12/15/2021
4.11.0 2,065,150 11/25/2021
4.10.0 580,981 11/11/2021
4.9.0 496,797 11/3/2021
4.8.0 150,349 10/28/2021
4.7.0 584,019 10/14/2021
4.6.0 1,119,678 9/23/2021
4.5.0 565,768 9/9/2021
4.4.0 256,896 9/2/2021
4.3.0 294,810 8/19/2021
4.2.0 479,677 8/12/2021
4.1.0 152,061 8/5/2021
4.0.0 472,457 7/23/2021
4.0.0-preview.7 15,139 6/18/2021
4.0.0-preview.6 14,360 6/7/2021
4.0.0-preview.5 7,649 5/21/2021
4.0.0-preview.4 14,674 5/7/2021
4.0.0-preview.3 9,215 4/22/2021
4.0.0-preview.2 10,915 4/1/2021
4.0.0-preview.1 21,981 3/17/2021
3.35.0 3,862,004 6/15/2021
3.34.0 273,131 6/10/2021
3.33.0 1,997,759 5/20/2021
3.32.0 367,458 5/12/2021
3.31.0 211,720 5/7/2021
3.30.0 676,688 4/20/2021
3.29.0 549,271 4/2/2021
3.28.0 255,918 3/25/2021
3.27.0 871,774 3/10/2021
3.26.0 300,852 3/4/2021
3.25.0 419,995 2/18/2021
3.24.0 431,151 2/10/2021
3.23.0 475,263 1/29/2021
3.22.0 475,323 1/20/2021
3.21.0 1,168,627 12/8/2020
3.20.0 1,040,301 11/19/2020
3.19.0 1,148,411 10/27/2020
3.18.0 523,767 10/14/2020
3.17.0 209,894 10/10/2020
3.16.0 223,827 10/7/2020
3.15.0 545,644 9/24/2020
3.14.0 211,043 9/15/2020
3.13.0 130,602 9/10/2020
3.12.0 799,574 8/26/2020
3.11.0 15,612 8/25/2020
3.10.0 142,109 8/18/2020
3.9.0 604,879 7/28/2020
3.8.0 1,087,454 6/16/2020
3.7.0 182,314 6/9/2020
3.6.0 630,558 5/21/2020
3.5.0 320,540 5/12/2020
3.4.0 210,697 5/1/2020
3.3.0 372,787 4/14/2020
3.2.0 118,560 4/7/2020
3.1.0 204,259 4/1/2020
3.0.1 349,989 3/18/2020
1.21.0 6,906,658 12/11/2019
1.20.0 677,186 11/6/2019
1.19.0 147,952 10/29/2019
1.18.0 284,558 10/15/2019
1.17.0 799,585 8/15/2019
1.16.0 662,414 7/2/2019
1.15.0 1,173,646 5/1/2019
1.14.0 1,311,948 3/25/2019
1.14.0-preview 21,074 2/25/2019
1.13.0-preview 26,994 12/18/2018
1.12.0 1,322,019 10/31/2018
1.11.0 300,493 9/19/2018
1.10.0 398,475 7/6/2018
1.9.0 1,464,168 5/3/2018
1.8.1 214,714 3/26/2018
1.7.0 187,581 12/14/2017
1.6.2 154,988 10/6/2017
1.6.1 2,851 10/5/2017
1.6.0 11,538 9/26/2017
1.5.1 71,972 8/24/2017
1.5.0 47,171 8/8/2017
1.4.0 245,179 6/12/2017
1.3.0 180,325 5/10/2017
1.2.1 101,172 2/13/2017
1.2.0 119,600 11/8/2016
1.1.1 113,711 9/27/2016
1.0.1 197,187 4/21/2016
1.0.0 10,015 3/30/2016
0.2.8-rc 10,945 6/24/2015

October 2017 Release Summary (version 1.6.1)

     Bug fix for Microsoft.Graph 1.6.1
     * Update Nuget package to reference Microsoft.Graph.Core 1.6.2