Microsoft Graph API - Source Code
The Microsoft Graph allows Microsoft cloud service to expose multiple APIs through one REST API endpoint. The API uses a single authentication system across consumer, education and commercial customers and provides unified metadata, payload format, error handling, and SDKs to expose productivity entities and their relationships. All APIs use JSON with the OAuth 2.0 protocol for authorization.

- Versions
- SDKs (10)
- Articles (6)
- How To (0)
- Source Code (27)
- Libraries (0)
- Developers (0)
- Followers (24)
- Changelog (45)
Sample Source Code (27)
The following is a list of sample source code snippets that matched your search term. Source code snippets are chunks of source code that were found out on the Web that you can cut and paste into your own source code. Whereas most of the sample source code we've curated for our directory is for consuming APIs, we occasionally find something interesting on the API provider side of things. If you know of some sample source code that would be of interest to the ProgrammableWeb community, we'd like to know about it. Be sure to check our guidelines for making contributions to ProgrammableWeb.
Title | Description | |
---|---|---|
![]() | Microsoft Graph Android Sample Code | The Microsoft Graph Android Sample Code demonstrates how to integrate the API into an application. Available requests against the service similar to the REST API. |
![]() | Microsoft Graph iOS Sample Code | The Microsoft Graph iOS Sample Code demonstrates how to use the SDK for iOS. Installation, getting started guide, and documentation with auth, items, collections, and errors available. |
![]() | Microsoft Graph Snippets AngularJS Sample Code by Microsoft | The Microsoft Graph Snippets AngularJS Sample Code by Microsoft shows the procedure for initiating the performance of common Office tasks in AngularJS apps using the Microsoft Graph API. The sample code supports direct HTTP calls to the API and requires Azure AD 2.0 endpoint for authentication. |
![]() | Microsoft Graph Excel To-Do List .NET Sample Code by Microsoft | The Microsoft Graph Excel To-Do List .NET Sample Code by Microsoft provides guidelines for Using the Microsoft Excel REST API to read and edit lists in a OneDrive for Business-stored Excel document. A developer must have Visual Studio 2015 and a Microsoft account to be able to deploy the sample code. |
![]() | Microsoft Graph Donations .NET Sample Code by Microsoft | The Microsoft Graph Donations .NET Sample Code by Microsoft provides guidelines for Using the Microsoft Excel REST API to read and edit a OneDrive for Business-stored Excel document. A developer must have Visual Studio 2015 and a Microsoft account to be able to deploy the sample code. |
![]() | Microsoft Graph Webhooks .NET Sample Code by Microsoft | The Microsoft Graph Webhooks .NET Sample Code by Microsoft shows the procedure for integrating webhook subscriptions functionality in .NET apps using the Microsoft Graph API. This way, the apps can listen to notifications about the data changes that occur in the Microsoft accounts of users. A developer must also have Visual Studio 2015, Azure Portal’s app ID and Key, a public HTTP endpoint for HTTP requests transmission, and a Microsoft account to be able to deploy the sample code. |
![]() | Microsoft Graph Snippets .NET Sample Code by Microsoft | The Microsoft Graph Snippets .NET Sample Code by Microsoft shows the procedure for initiating the performance of common Office tasks in ASP.NET apps using the Microsoft Graph API. The sample code processes data using the Microsoft Graph .NET Client Library and while its authentication requires Microsoft Authentication Library (MSAL) and Azure AD endpoint. A developer must also have Visual Studio 2015 and a Microsoft account to be able to deploy the sample code. |
![]() | Microsoft Graph Connect .NET Sample Code by Microsoft | The Microsoft Graph Connect .NET Sample Code by Microsoft demonstrates the procedure for deploying the Microsoft Graph API when connecting the ASP.NET 4.6 MVC web app to the Azure Active Directory for work or school, or a Microsoft personal account for sending email.Its authentication requires Microsoft Authentication Library (MSAL) and Azure AD endpoint. A developer must also have Visual Studio 2015 and a Microsoft account to be able to deploy the sample code. |
![]() | Microsoft Graph Connect Ruby Sample Code by Microsoft | The Microsoft Graph Connect Ruby Sample Code by Microsoft by Microsoft shows how to use the Microsoft Graph API to retrieve users’ Microsoft account data on Ruby on Rails web apps. The sample code’s authentication requires Azure AD v2.0 endpoint. A developer must also have Ruby 2.1, rails framework, bundler dependency manager, and a Microsoft account to be able to deploy the sample code. |
![]() | Microsoft Graph Connect PHP Sample Code by Microsoft | The Microsoft Graph Connect PHP Sample Code by Microsoftshows how to use the Microsoft Graph API to retrieve users’ Microsoft account data from PHP web apps. The sample code’s authentication requires Azure AD v2.0 endpoint. A developer must also have PHP 5.6 or 7, a PHP dependency manager, and a Microsoft account to be able to deploy the sample code. |
![]() | Microsoft Graph Webhooks NodeJS Sample Code by Microsoft | The Microsoft Graph Webhooks NodeJS Sample Code by Microsoft shows the procedure for integrating webhook subscriptions functionality in NodeJS apps using the Microsoft Graph API. This way, the apps can listen to notifications about the data changes that occur in the Microsoft accounts of users. A developer must have NodeJS v4 or v5 and a Microsoft Azure-registered app to be able to deploy the sample code. |
![]() | Microsoft Graph App-Only Token NodeJS Sample Code by Microsoft | The Microsoft Graph App-Only Token NodeJS Sample Code by Microsoft is a guide for integrating the Microsoft Graph API in NodeJS service or daemon app. It shows the procedure for using NodeJS to request an app-only access token in addition to creating a user-specific calendar event in a tenant. Its deployment requires a Microsoft account. |
![]() | Microsoft Graph Connect NodeJS Sample Code by Microsoft | The Microsoft Graph Connect NodeJS Sample Code by Microsoft shows how to use the Microsoft Graph API to retrieve users’ Microsoft account data from Node.js web applications. The sample code supports direct HTTP calls to the API and requires Azure AD 2.0 endpoint for authentication. A developer must also have NodeJS v4 or v5 and a Microsoft account to be able to deploy the sample code. |
![]() | Microsoft Graph Meeting Feedback Java Sample Code by Microsoft | The Microsoft Graph Meeting Feedback Java Sample Code by Microsoft shows the procedure for deploying Microsoft Calendar and email data in the construction of Android applications that allow the attendees of meetings to conceal their identities when sending feedback. Designed to communicate with the Microsoft Graph API, the sample code’s Office 365 endpoints facilitate access to calendar events and support the sending of emails on behalf of users. Its deployment requires the onward of Android API Level 15 devices, Android Studio v1.0, and Office 365. |
![]() | Microsoft Graph Connect Java Sample Code by Microsoft | The Microsoft Graph Connect Java Sample Code by Microsoft by Microsoft shows how to use the Microsoft Graph API to retrieve users’ Microsoft account data from Android apps. The sample code’s authentication requires Azure AD v2.0 endpoint. A developer must also have the onwards of Android Studio v1 and Java Development Kit (JDK) 7 to be able to deploy the sample code. |
![]() | Microsoft Graph Snippets Java Sample Code by Microsoft | The Microsoft Graph Snippets Java Sample Code by Microsoftshows the procedure for initiating the performance of common Office tasks in Android apps using the Microsoft Graph API. The sample code processes data using the Microsoft Graph Client Library and requires Active Directory Library (ADAL) authentication. |
![]() | Microsoft Graph Image Discovery Objective-C Sample Code by Microsoft | The Microsoft Graph Image Discovery Objective-C Sample Code by Microsoftprovides demonstrations for building apps for taking pictures or searching them from the web and processing the images. The sample code also provides functionalities for storing the images in cloud applications or emailing them to target recipients. A developer must have access to Xcode, CocoaPods dependency manager, and a Microsoft account to be able to deploy the sample code. |
![]() | Microsoft Graph Profile Picture Objective-C Sample Code by Microsoft | The Microsoft Graph Profile Picture Objective-C Sample Code by Microsoft provides demonstrations for deploying the Microsoft Graph API profile picturefunctionalities in iOS applications. The sample code uses the API’s endpoint to access Microsoft cloud’s data relationships and other parameters.A developer must have access to Xcode, CocoaPods dependency manager, and a Microsoft account to be able to deploy the sample code. |
![]() | Microsoft Graph Apple Watch Objective-C Sample Code by Microsoft | The Microsoft Graph Apple Watch Objective-C Sample Code by Microsoft – aka Who Are You? – demonstrates the use of the Microsoft Graph API to integrate profile checking functionality in Apple watch iOS applications. Its functionality allows meeting attendees to find out the identities of their colleagues.The sample code operates on WatchOS 2.2 and requires the use of Active Directory Authentication Library for authenticating iOS, and a Microsoft Graph endpoint for collecting the profiles of users. A developer must have Xcode v7.3.1, install a CocoaPods dependency manager, and have a Microsoft account to be able to deploy the sample code. |
![]() | Microsoft Graph Face API Swift Sample Code by Microsoft | The Microsoft Graph Face API Swift Sample Code by Microsoft shows how the Microsoft Graph API works with theMicrosoft Cognitive Services Face API to implement image recognition concepts using iOS apps written in Swift language. A developer must have Xcodev7.3.1, install a CocoaPods dependency manager, and have a Microsoft account to be able to deploy the sample code. |
![]() | Microsoft Graph Snippets Objective-C Sample Code by Microsoft | The Microsoft Graph Snippets Objective-C Sample Code by Microsoft shows the procedure for initiating the performance of common Office 365 tasks in Objective-C iOS apps using the Microsoft Graph API. The sample code shows how to use direct HTTP calls to access developer resources such as the Microsoft Azure Active Directory (AD) and Office 365 APIs. A developer must have access to Xcode, CocoaPods dependency manager, and a Microsoft account to be able to deploy the sample code. |
![]() | Microsoft Graph Connect Objective-C Sample Code by Microsoft | The Microsoft Graph Connect Objective-C Sample Code by Microsoft shows how to use the Microsoft Graph API to retrieve users’ Microsoft account data from iOS apps written in Objective-C. The sample code processes data using the Microsoft Graph Client Library and requires Active Directory Library (ADAL) authentication. A developer must also have Xcode, CocoaPods dependency manager, and a Microsoft account to be able to deploy the sample code. |
![]() | Microsoft Graph Snippets Swift Sample Code by Microsoft | The Microsoft Graph Snippets Swift Sample Code by Microsoftshows the procedure for initiating the performance of common Office tasks in Swift-written iOS apps using the Microsoft Graph API. The sample code processes data using the Microsoft Graph Client Library and requires Active Directory Library (ADAL) authentication.A developer must have Xcodev7.3.1, install a CocoaPods dependency manager, and have a Microsoft account to be able to deploy the sample code. |
![]() | Microsoft Graph Connect Swift Sample Code by Microsoft | TheMicrosoft Graph Connect Swift Sample Code by Microsoftshows how to use the Microsoft Graph API to retrieve users’ Microsoft account data from Swift-written iOS apps. The sample code supports direct HTTP calls to the API and requires Active Directory Library (ADAL) authentication. A developer must also have Xcode v8.2.1, install a CocoaPods dependency manager, and have an Office 365 account to be able to deploy the sample code. |
![]() | Microsoft Graph UWP Meetingbot C# Sample Code by Microsoft | The Microsoft Graph UWP Meetingbot C# Sample Code by Microsoft provides the procedure for introducing the Microsoft Graph API’s functionalities into UWP apps that use Cortana voice commands. The sample codeuses Microsoft Graph .NET sample code and requiresVisual Studio 2015, Windows 10, and Microsoft account. |
![]() | Microsoft Graph UWP Excel C# Sample Code by Microsoft | The Microsoft Graph UWP Excel C# Sample Code by Microsoft provides demonstrations for deploying the Microsoft Graph API and Microsoft Excel API. It shows developers the procedure for deploying the Office Graph API in native applications for purposes of accessing Excel workbooks stored in applications such as OneDrive for Business and SharePoint Online. The sample code’s use requiresVisual Studio 2015, Windows 10, and Office 365 for Business account. |
![]() | Microsoft Graph UWP Snippets C# Sample Code by Microsoft | The Microsoft Graph UWP Snippets C# Sample Code by Microsoft shows the procedure for using the Microsoft Graph functionality to establish connections between a user’s Windows 10 universal app and Office 365. Its full-scale deployment for enterprise purposes requires the Azure AD endpoint and the Azure Management Portal.It also requires Visual Studio 2015, Windows 10, and Microsoft account. |