I have created an bot for microsoft teams with power virtual agents. This bot works fine and people can talk with it in ms teams and give the bot some information about dates. For example you could tell the bot a start-date and an end-date for days you aren't able to work.
With the authentification in teams the bot also knows the username and the id of the person, who is talking with it.
Now I like to create an automated flow, which the bot should trigger with the infos like username, userid, startdate and enddate, which should do the following steps:
open/find the specific user's calendar in outlook/teams (I'm pretty sure both use the same calendar)
create for each day in the range of startdate and enddate a (full-day) entry, which says "unavailable"
for each conflict with another meeting in entries of Step 2. cancel the meeting (for the user with username)
post a summary in a specific ms teams channel
I got Step 4 already working fine.
Step 2, I think I've figured out aswell, but with regard to my following problem at Step 1:
There is the template flow: Get calendar, which returns (all?) available calendars. And there is another flow template for creating entries in a specific calendar(Step 2 with option full-day entry), which needs the calendar ID to work.
My big problem is, how am I supposed to get the calendar ID of a specific user?
Is there a way to get the specific calendarID for a username or a userid?
And then what can I do about Step 3?
Thank you a lot for your help.
greets Vulnin
GET https://graph.microsoft.com/v1.0/{id | userPrincipalName}/calendar
. i.stack.imgur.com/Ngpkq.png For point 3 Only the organizer can cancel the meeting. Please refer to this document. – Mamatha-MSFTPOST https://graph.microsoft.com/v1.0/users/{id | userPrincipalName}/events/{id}/decline
request. – Mamatha-MSFT