blog.atwork.at

news and know-how about microsoft, technology, cloud and more.

List Flows as Admin V2 API endpoint

A year ago, Microsoft announced the "Transition to List Flows as Admin V2 action from deprecated List Flows as Admin action" for Power Automate. Well, we were using the old API endpoint for working with flows in our own software until it stopped working recently. It took some time until we found workarounds or a successor. Also the PnP modules still are using the old API, and the endpoint address is currently not documented on any Microsoft website. Find it here!

In the Power Platform, there is a Connector Power Automate for Admins that allows you to manage flows within your own flows (like the CoE does). Chris Garty wrote an article about the successor at "Transition to List Flows as Admin V2 action from deprecated List Flows as Admin action on the Power Automate Management connector, along with associated APIs". This concentrates on using the new List Flows as Admin (V2) action.

For us as developers working with the REST endpoints, this information was important, but we missed the new endpoint. The Microsoft PnP modules also could not help, since they are still using the old API. In fact, we couldn't find any indication anywhere of how to use the Flows API version 2 in our code.

image

After some research, we found this helpful article "Power Automate API changes - v2 Admin scope now needs user_impersonation" that there is an API version 2 endpoint from the great John Liu. As so often, thank you, John!

Then another MVP, Milan Holemans, provided another sample in the PnP GitHub issues - which is in fact simple: Just add /v2 and use the same API version as here:

https://api.flow.microsoft.com/providers/Microsoft.ProcessSimple/scopes/admin/environments/[Your-environment]/v2/flows?api-version=2016-11-01

Authentication and user permissions can remain as before. No changes are necessary (at present).

Thank you dear colleagues! As is often the case, finding a solution is a process, and the solution itself is sometimes simple.

We hope this information helps other developers who work directly with the REST endpoint and are switching to version 2.

Loading