Tag Archives: adaljs

Mail Addin For Outlook Using Office 365 APIs (ADAL.js, AngularJS, WebApi, Azure AD)

In this blog post you’ll see an example of Mail Add-in for Outlook. I was just working with Office 365 APIs and this is just something that I’ve decided to share. It should be seen as a simple example of how we can consume data that Office 365 APIs provide.

The authentication is taken care of with the “new” Javascript library ADAL.js (Active Directory Authentication Library for Javascript), AngularJS for frontend, .NET WebApi and Node.js for backend.

snagit0
Context – Mail Addin for Outlook providing data from O365 APIs and custom REST APIs

What this sample Mail Add-in for Outlook does

  • Consumes Office 365 Mails API  – showing related emails to current – one that we’ve are just looking at

snagit1

  • Consumes Office 365 Files API – showing related files to current email – one that we’ve are just looking at

snagit2

  • Provide data from custom REST API – showing Employees of a company found in email based on domain name
    • Employees are potentially saved in external system
    • REST API has enabled Odata filtering

snagit3

  • Provides data from custom REST API – showing fictional financial Reports of a company found in email based on domain name
    • Financial Reports are potentially saved in external system
    • REST API has enabled Odata filtering

snagit4

Code and all required steps to build the project are available in GitHub repository (https://github.com/matejv1/mail-addin-for-outlook-consuming-office365-api). Next step is to rewrite the whole project into Typescript, which will hopefully be done in next week or so – with Typescript we get all the benefits of strongly typed languages like C#, it’s definitely worth to check it out.

Resources:
Introducing ADAL JS v1 by Vittorio Bertocci
ADAL JS & CORS with O365 APIs (Files & SharePoint) by Andrew Connell
Continuous deployment using GIT in Azure App Service By Cephas Lin