Outlook addins
Integrate Outlook with third-party services using add-ins built on JavaScript/HTML, enabling seamless access to emails, meetings, and more.
Outlook add-ins (and Office add-ins in general) are integrations built by third parties into Outlook by using Microsoft's web-based platform. Outlook add-ins are essentially JavaScript/HTML code that runs in the context of a browser in a sandbox with special access to Outlook items like email messages, meeting requests, responses and cancellations, and appointments.
Most Outlook add-ins are built to provide convenient integrations to a third-party system or service right from Outlook, like Customer Relationship Management, Customer Service, and Project Management,... and the add-in developers all end up developing the same or similar elements of their app:
Provision a backend API that will support the client code.
Implement user management (login/logout/session) which needs to be correlated with an authenticated Outlook user.
Support one or more 3rd party authorization flows. For example, a user needs to link his or her CRM account, maybe also a cloud file storage.
Proxy requests to 3rd party API's. Quite often direct API communications from JavaScript are blocked by CORS in browsers.
Storing various add-in configurations for users or organizations.
Offline mailbox access. Often special workers are implemented to run in the background when an add-in user is offline.
Aurinko aims to provide the necessary backend functionality for these add-ins so that developers could focus on the client code to create the best user experiences. Here are the steps to start using Aurinko as a backend API for your Outlook:
Get your developer API keys and put your app's client id into your client code or better pass it from your manifest file as a url parameter.
In most cases you want to have offline mailbox access or ability to access Graph API so provision your Azure app registrations.
After your add-in client code has initialized and gained access to Office JS API, test if the current user is already authenticated with Aurinko (logged in):
curl -X GET -G https://api.aurinko.io/v1/user
For a logged in user the request will return the user info and its active Aurinko accounts:
Otherwise, 401 Unauthorized status will be returned in which case your addin needs to ask the user to login (see next step).
Office JS API provides a special idToken that can be used to validate a current user but we recommend using OAuth2 authorization flow to confirm the current user as this way your app can also get offline access to Graph API:
The important parameter here is
userAccount = primary
which turns this account authorization into user session initialization (user login). Upon successful authentication and authorization the redirect toreturnUrl
will result in setting a session cookie which will allow your app to stay recognized by Aurinko until the user logs out.In addition to the login Aurinko gets access to Graph API with the following scopes: Mail.Read, Mail.Send. This will allow your app to work with the Outlook account while the user is not using your Outlook addin.
Authorize access to a 3rd party API. Contact us at support@aurinko.io to arrange adding a connector for your system, i.e. {MyCRM}.
Upon a successful authentication and authorization an Aurinko account representing your 3rd party API {MyCRM} will be added and your app can issue the following request again:
The request will return all Aurinko accounts associated with the current user session:
Now your addin can access either Graph API (through Aurinko's unified API) or the 3rd party API. Specify an account id in the special header
X-Aurinko-AccountId
and use AurinkoEmail/Calendar/Contact
to access those accounts.
Last updated