Read Office 365 Message Centre using Office 365 Management API
I started my career as a web developer. Since then it is one of the best decision I have ever taken. Web has been evolving and because of it, low code platforms like Microsoft Flow makes our life a lot easier. In this post, I am going to show you how to read messages from Office 365 Message Centre using its API.
Office 365 Management API is well documented at https://docs.microsoft.com/en-us/office/office-365-management-api/office-365-management-apis-overview
Since it is web api, Microsoft Flow can easily make HTTP request and parse the response. To do it, let’s register an app in Azure Portal first. As we are going to use it from Microsoft Flow, you need to create Web App / Api type application. Another point is to grant the correct permission to the app. Its permission should be set as below.
Ensure you click Grant Permissions after choosing correct permissions. Otherwise, the authroisation will fail.
After this, the rest is quite straight forward. I have created the following Flow. In general, it will
- read the last message time from my Google sheet
- check the value of last message time. It sets the correct StartTime condition in HTTP step so we won’t be retrieving same messages over and over again.
- parse the data and insert into my Google sheet
HTTP request step is setup as below. It is quite straightforward. Please note we need to filter StartTime properly.
Once the Flow is executed, all messages are nicely inserted into my Google sheet.
This is all because of the power of Web. Of course, Microsoft Flow makes things easier. That’s all for now.