Automating Bayzat leave calendar to post daily list in Microsoft Teams group

I was wondering if I can have a feature to post who-are-all-on-planned-leave list daily in the HR/leaders group in Microsoft Teams. Searched for a plugin in the marketplace, and tried to find a API also. Finally, contacted the Bayzat support and found they don’t have a developer API available at the moment. Then I went though the normal HTTP calling methods and found it worked well. Sharing with you, hoping someone will find this useful in future.

Here is the Adaptive Card output you get in Teams:

image

This is the high level view of the Power Automate App Flow

image

Details:

Step 1 – Get the authentication access token

This token is required for you to get access to any APIs/URLs. Use the login API for this:

image

Step 2 – Read the Leave Calendar

My requirement is only to read one single day, so I am passing utcNow()

image

Step 3 – Modify the response data as per your requirement

My requirement is small that, I need only list of people marked OOO for this particular day

image

Step 4 – Post to Microsoft Teams

I chose to post the data in Teams as an Adaptive Card, so I am posting in that format

image

Contact me if you need some clarifications. Make sure to add sufficient validations to make this flow error free.