Microsoft.Graph 1.6.2

Microsoft Graph .Net Client Library

Microsoft Graph Client Library allows you to call Office 365, Azure AD and other Microsoft services through a single unified developer experience.

Install-Package Microsoft.Graph -Version 1.6.2
dotnet add package Microsoft.Graph --version 1.6.2
paket add Microsoft.Graph --version 1.6.2
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.

Other resources

License

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

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

Release Notes

October 2017 Release Summary (version 1.6.2)

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

Version History

Version Downloads Last updated
1.6.2 (current version) 10,062 10/6/2017
1.6.1 224 10/5/2017
1.6.0 4,347 9/26/2017
1.5.1 12,327 8/24/2017
1.5.0 5,878 8/8/2017
1.4.0 33,147 6/12/2017
1.3.0 23,138 5/10/2017
1.2.1 38,338 2/13/2017
1.2.0 41,331 11/8/2016
1.1.1 16,793 9/27/2016
1.0.1 23,362 4/21/2016
1.0.0 1,566 3/30/2016
0.2.8-rc 6,770 6/24/2015