How to update an event in shared calendar via graph api?

Denis Senkevich 0 Reputation points
2023-11-24T09:56:29.8566667+00:00

I use microsoft graph api to work with outlook calendar events. All CRUD opperations work well. But I also need to update events in shared calendars. And there is an issue.
F.eg. there are two users: Owner (email is owner@outlook.com) and Guest (email is guest@outlook.com).

  1. I create an event as Owner. There are two attendees Owner and Guest.
  2. Add 'write' permission for Guest, that gives him access to work with Owner's calendar.
POST:https://graph.microsoft.com/v1.0/me/events/eventId/calendar/calendarPermissions
body: {
	emailAddress: {
    	name: Guest,
    	address: guest@outlook.com,
    },
   	isInsideOrganization: false,
   	isRemovable: true,
    role: 'write',
}

where eventId is 'id' of the event that I created on the first step.
3. In Guest's mailbox I see an invitation that owner@outlook.com wants to share their calendar with me (Guest). And I (Guest) am able to update the event manually (via Outlook calendar).
4. There is an issuse: when I update the event via graph api as Guest (guest@outlook.com) I got an error.

PATCH:https://graph.microsoft.com/v1.0/users/owner@outlook.com/events/eventId

where eventId is 'id' of the event that I created on the first step.
And the error:
"code": "ErrorInvalidUser"

"message": "The requested user 'owner@outlook.com' is invalid."

Also I get shared calendar in GET:https://graph.microsoft.com/v1.0/me/calendars request (as guest@outlook.com).
And see Guest's 'write' persmission in GET:https://graph.microsoft.com/v1.0/me/events/eventId/calendar/calendarPermissions
request (as owner@outlook.com).

The question is: What have I missed or implemented wrong?
Thank you.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,387 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Akash Jadav 85 Reputation points Microsoft Vendor
    2023-12-02T11:20:26.8+00:00

    Hello @Denis Senkevich

    We would like to confirm that, you are using office user, not Microsoft365 business user.

    We couldn’t find any official article to allow guest user to edit such shared calendar. Seems at this moment it isn’t feasible to achieve it because based on out official article Share calendars with guest users (external user) is limited with Free/busy information (view permission).  

    For this feature, if you would like to submit feedback to Microsoft, please check information provided in UserVoice Pages (microsoft.com). Your kind understanding and co-operation will be highly appreciated.

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    0 comments No comments