Microsoft.Graph 1.6.0

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.0
dotnet add package Microsoft.Graph --version 1.6.0
paket add Microsoft.Graph --version 1.6.0
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.

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

September 2017 Release Summary (version 1.6.0)

     New features for 1.6.0
     * Added columns, contentTypes, items, and lists to the site type.
     * Added the columnDefinition, columnLink, contentType, fieldValueSet, list and listitem types.
     * Added the scoredEmailAddress, phone, website, and personType types.
     * Added the booleanColumn, calculatedColumn, choiceColumn, currencyColumn, dateTimeColumn, systemFacet,
       defaultColumnValue, lookupColumn, numberColumn, personOrGroupColumn, textColumn, and contentTypeOrder types.
     * Added the person type. It is accessible from the user type.
     * Added the listInfo, contentTypeInfo, and folderView types.
     * Added the list and listItem properties to the sharedDriveItem type
     * Added the audioBitePerSample, audioChannels, audioFormat, audioSamplesPerSecond, fourCC, and frameRate properties to the Video type.
     * Added a Search function to driveItems.

Version History

Version Downloads Last updated
1.6.0 (current version) 0 9/26/2017
1.5.1 5,667 8/24/2017
1.5.0 4,207 8/8/2017
1.4.0 22,802 6/12/2017
1.3.0 17,009 5/10/2017
1.2.1 32,037 2/13/2017
1.2.0 36,410 11/8/2016
1.1.1 12,326 9/27/2016
1.0.1 22,488 4/21/2016
1.0.0 1,544 3/30/2016
0.2.8-rc 6,482 6/24/2015