简体   繁体   中英

Get Microsoft Graph API Calendar published URL

I have a requirement where I need to access publicly shared URL of a calendar(also want to share calendar using the API) using microsoft graph api. But it seems like its not available using GraphServiceClient. What Im trying to achieve is

        var cal = await graphClient...<anything>....Calendar.Request(options).GetAsync();
        if(cal.CanShare.HasValue && cal.CanShare.Value)
        {
            // get the published URL of the calendar here
        }

It seems the center point here is that you're expecting /Me/Calendars to include shared calendars. It does not. In order to access someone else's calendar that has been shared, you must access via the /Users/<id>/Calendars/ URL.

So for example if user1@fabrikam.com logs in, and user2@fabrikam.com has shared his calendar with him/her, then:

  1. /Me/Calendars would ONLY show calendars in User1 mailbox.
  2. /Users/user2@contoso.com/Calendars would show calendars user2 has shared with user1

Hope it helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM