Microsoft Graph Subscription using Power Automate Guide
Image Source: Shutterstock.com
Power Automate
Sep 26, 2023 11:44 AM

Microsoft Graph Subscription using Power Automate Guide

by HubSite 365 about Pieter Veenstra [MVP] (SharePains)

Microsoft MVP and Microsoft Productivity Principal Architect at HybrIT Services

External Blog Post
Citizen Developer

Power SelectionPower Automate

Uncover events with MS Graph in Power Automate! Subscribe to any changes, define change types and trigger flows. Become a MS Graph expert!

Explaining the Microsoft Graph using Power Automate and the Subscription Process

Today we discuss a blog post written by Pieter Veenstra, a Microsoft MVP at SharePains, which outlined the process of subscribing to Microsoft Graph using Power Automate.

The author focuses on the Graph API, illustrating how you can subscribe to different "things" and trigger a flow when events transpire. These events can fall under various categories; Call Records, Channels, Chat, Chat Message, Contact, Conversation Members, Drive Item, and more. Once subscribed, each of these categories can provide you with updates about any changes made, whether it's a creation, update or deletion event.

What is more, the author delves into creating two flows within Power Automate. He termed the first as a "subscription flow," designed to operate on a daily basis, and the second to handle the process that they want the subscription to subsequently trigger.

The blog post details an example where the author subscribes to CallRecords update. The longevity of each subscription has to be specified beforehand, and with the help of an expression (addDays(UtcNow(), 1)) the author set the subscription expiry time to 24 hours after the subscription flow operates.

Following this, the author discusses the significance of the List Callback URL action, detailing how it provides the URL of the second flow that is designed to trigger when a new call comes in. This URL aligns with the one provided by the "When a HTTP request is received" action of the second flow, which is triggered every time a Call record is updated or created.

Attention is then given to Subscription URIs. Necessary for each varying "thing" we may wish to subscribe to, the specific URI supplied has to reflect the subscription type. In the case of the Call records example, the URI was /communications/callRecords.

In the final phases of the operation, it is necessary to create the second flow. Triggered each time a change happens, like, for instance, every time a call is made, the second flow springs into action. The flow can also be triggered at the time of subscription. The blog post also highlights the schema specified which triggered this action.

The validation token, received following this step, can then verify if the flow triggered is due to the initial subscription or due to an update in the call record triggering the flow. The author indicates responding back to the parent flow with a success code (200) to confirm that the subscription was received successfully. The data provided by the trigger of the flow can then be used post this acknowledgement.

Summing up, this blog post imparts comprehensive understanding on using Power Automate for subscribing to Microsoft Graph. For anyone interested in automating processes contingent on diverse categories of events, Power Automate proves itself an effective tool towards streamlined operational functionality.

Read the full article Subscribe to Microsoft Graph using Power Automate

Power Automate - Microsoft Graph Subscription using Power Automate Guide

Learn about Subscribe to Microsoft Graph using Power Automate

Subscribe to Microsoft Graph using the MS Automate tool is a crucial skill to acquire. A deep dive into this feature can initiate a series of steps or actions, also known as flows, whenever an event happens. It's especially important if you often work with the Graph API.

Microsoft Graph Subscriptions offers benefits that can transform your workflow. To enjoy these advantages, you can deliberately sign up to changes in various features. These include but not limited to Call Records, Channels, Chats, Chat Messages, Contacts, Conversation Members, Drive Items, Events, Groups, and so much more.

When opting for a service, you are asked for your preference for the change type. This may include the event being created, updated, or deleted. Understanding these change types helps you gain control over what type of action triggers your flow.

  • Created
  • Updated
  • Deleted

As part of this learning process, you would be creating two different workflows. Firstly, a subscription flow that would be set up for daily operation and then a secondary operative flow which would be used to handle the triggered process.

The unique thing to understand here is their distinctive features. For example, for each service that you subscribe to, an expiration date must be specified. However, if the process resubscribes every day, the subscription expiry time can be set to 1 day after the process starts running again.

The crux of the matter is the Callback URL action, which assists in learning the URL of the processing that is needed to be set in motion when a new call arrives. This URL must correspond with the URL provided by the 'When a HTTP request is received' action of the flow.

You might be wondering, 'What does each subscription stand for?' Each subscription represents various things that you might be interested in signing up for. Thus, each different thing requires a specific UTI to be supplied. It all depends on what you choose.

Next, changes handle creation which is necessary. An additional flow is needed when a change is made which then triggers the flow. Hence, for every call made, the workflow is set in motion.

Many may question whether this new flow also comes into effect when we subscribe? Yes, it does. However, to ensure the workflow effectively supports the change, a schema must be stipulated.

The validation token then steps in, helping us recognize whether the initiation was due to the initial subscription or the call record update. All in all, this feature helps smoothen the workflow by enabling user acknowledgements and utilization of supplied data by the flow trigger.

Learning about the MS Automate tool alongside the Graph API can be instrumental in subscribing to 'things' and triggering flows when events transpire.

With comprehensive training, you will be able to implement the change types effectively, increasing productivity and efficiency in your work environment.

More links on about Subscribe to Microsoft Graph using Power Automate

MS Graph subscriptions using Power Automate
Jan 12, 2023 — Using the MS Graph subscription model it is possible to subscribe to any changes in on of the following: Call Records; Channels; Chat ...
How To Consume Microsoft Graph Using Power Automate
Nov 6, 2021 — The first thing we need to do is to create App Registration in our Azure AD. Go to portal.azure.com > Azure Active Directory > App registrations ...
Integrate with Microsoft Graph API and Power Automate
Feb 21, 2023 — Learn how to extend Priva Subject Rights Requests capabilities by integrating with Microsoft Graph API and Power Automate.

Keywords

Microsoft Graph, Power Automate, Subscribe, API, Microsoft Flow, Automation, Webhook, Data Integration, Microsoft 365 Integration, Cloud Automation