OneDrive Files Sample Code

The following samples are available on GitHub in the OneDrive organization. All of our samples are licensed under the MIT license and are open source projects.

Additional samples for the Microsoft Graph are available from the Microsoft Graph organization on GitHub.

File handlers

  • Markdown file handlers An ASP.NET MVC app that allows a rich preview and edit experience for Markdown text files from OneDrive and SharePoint using File Handlers 2.0

Windows / .NET

JavaScript

  • OneDrive Explorer (JavaScript) An HTML explorer for the OneDrive API. Highlights using the OneDrive API from a single page web application.

  • OneDrive Text Editor (JavaScript) An example application that uses the OneDrive file picker and Microsoft Graph API to open, edit, and save text files from OneDrive and OneDrive for Business.

  • File picker for JavaScript Connect your JavaScript web application or website to open and save files with OneDrive without writing any user interface code.

ASP.NET MVC

  • OneDrive Webhooks Example An ASP.NET MVC app that demonstrates how to use OneDrive webhooks to receive change notifications from OneDrive and retrieve files that have changed.

  • Markdown file handlers An ASP.NET MVC app that allows a rich preview and edit experience for Markdown text files from OneDrive and SharePoint using File Handlers 2.0

  • Data Robot Azure Function An example ASP.NET MVC application and Azure Function to handle webhook notifications and data collaboration in Excel files.

Office Add-ins

Apple iOS

Android

  • OneDrive Explorer (Android) This sample illustrates basic concepts for interacting with the OneDrive API from an Android application.

  • File picker for Android Connect your Android app to OneDrive with a few lines of code. No need to use the API or build a user interface.