Get Started with Exchange Online REST APIs for Office 365 development in .NET

If you intend to try your hands on building an application that interacts with Exchange Online and utilizes Office 365 REST APIs for mail, calendars, and contacts, the steps below should help.

  1. Get your Office 365 tenant developer account (if you need more than one license, link your tenant to 30 days free trial of Office)

  2. Add an Azure subscription – you can use your MSDN subscription for it

    Getting Started with Your MSDN Subscription

  3. Register your app in Azure AD and add appropriate permissions:

    a. From Visual Studio 2013 using Connected service: and

    b. From Windows Azure portal for O365 (to manually register it):

    c. Outlook Dev Portal App Registration Tool

  4. Build your application. If you are using Visual Studio to do so, you’ll need to install ADAL library through Nuget. Please also make sure you use .NET 4.5 or above if you are using latest ADAL library.

Tools you can use to understand how the flow works. You’ve an option to play with sample data or sign in and work with your own Office 365 tenant account.
(Only for authorization grant flow)

  1. Apisandbox

  2. Oauthplay

Understanding Permissions:
Office 365 application manifest and permission details

Understanding Oauth grant flows:
There are two grant flows:

  1. Authorization code grant flow – this is said to run in delegation mode. The user gives assent to the app to access his own mailbox.

    Please see and

  2. Client Credential flow – this is said to run in app-only mode. Also known as Daemon app or service app. The admin (tenant administrator/ global administrator) needs to give assent to the app.

    Please see and

Important Samples in .NET:
Authorization grant flow:

Client credential flow: