Microsoft.Graph.Core 1.14.0-preview

Microsoft Graph Core Client Library implements core functionality used by Microsoft Graph Client Libraries.

This is a prerelease version of Microsoft.Graph.Core.
There is a newer version of this package available.
See the version list below for details.
Install-Package Microsoft.Graph.Core -Version 1.14.0-preview
dotnet add package Microsoft.Graph.Core --version 1.14.0-preview
<PackageReference Include="Microsoft.Graph.Core" Version="1.14.0-preview" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Microsoft.Graph.Core --version 1.14.0-preview
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

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.

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

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.

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.

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

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.

Release Notes

February 2019 Release Summary (version 1.14.0-preview)

- Authentication handler added.
- Removed Newtonsoft.Json package reference upper bound limitation.
- Makes GraphClientFactory internal.
- HttpProvider uses GraphClientFactory.

Showing the top 10 GitHub repositories that depend on Microsoft.Graph.Core:

Repository Stars
SharePoint/PnP
SharePoint / Office 365 Developer Patterns and Practices
SharePoint/PnP-PowerShell
SharePoint PnP PowerShell CmdLets
Kyrodan/KeeAnywhere
A cloud storage provider plugin for KeePass
SharePoint/PnP-Sites-Core
Office 365 Dev PnP Core component (.NET) targeted for increasing developer productivity with CSOM based solutions.
SharePoint/PnP-Tools
Scripts and tools for Office 365 and SharePoint - More for IT Pro's
microsoftgraph/msgraph-sdk-dotnet
Microsoft Graph Client Library for .NET!
viciousviper/DokanCloudFS
A virtual filesystem for various publicly accessible Cloud storage services on the Microsoft Windows platform.
OneDrive/onedrive-sdk-csharp
OneDrive SDK for C#! https://dev.onedrive.com
Rambalac/ACDDokanNet
Dokan.NET based driver for Amazon Cloud Drive
microsoft/BusinessPlatformApps

Version History

Version Downloads Last updated
1.17.0 3,643 8/15/2019
1.16.0 15,075 7/3/2019
1.16.0-preview.3 248 6/21/2019
1.16.0-preview.2 418 6/14/2019
1.15.0 189,168 5/1/2019
1.15.0-preview.2 754 4/27/2019
1.15.0-preview.1 560 4/19/2019
1.14.1 49,738 3/29/2019
1.14.0 93,183 3/25/2019
1.14.0-preview 14,101 2/25/2019
1.13.0-preview 14,272 12/18/2018
1.12.0 416,650 10/31/2018
1.11.0 171,501 9/19/2018
1.10.0 270,872 7/6/2018
1.9.0 250,776 5/3/2018
1.8.1 124,282 3/23/2018
1.7.0 129,056 12/14/2017
1.6.2 120,270 9/26/2017
1.6.1 44,540 8/24/2017
1.6.0 24,337 8/8/2017
1.5.0 148,833 6/12/2017
1.4.0 104,854 5/10/2017
1.3.1 29,490 4/3/2017
1.3.0 141,978 11/8/2016
1.2.1 87,447 9/27/2016
1.1.1 7,032 8/8/2016
1.1.0 565 8/6/2016
Show less