0
votes

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
        }
1
you're doing graphClient.Me how's that publicly available? that resource is specific to your accountAarif
@Aarif Yes even if thats specific to my account, the published calendar URL is accessible from anywhere and its not implemented with graphclient. I can access any user's calendar using user id .Manu Mohan Thekkedath

1 Answers

0
votes

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 [email protected] logs in, and [email protected] has shared his calendar with him/her, then:

  1. /Me/Calendars would ONLY show calendars in User1 mailbox.
  2. /Users/[email protected]/Calendars would show calendars user2 has shared with user1

Hope it helps.