Hi @Mdx
Thank you for your question. Are you having issues when:
- You manually create and assign the calendar to a user (through the admin portal or PowerShell)
- You do it on Graph Explorer
- You do it on PostMan
- Or only when you're using the SDK?
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi,
We have a calendar application that create many appointment for different user (outside our organization). And we want these users to be able to see their appointments in their outlook calendars.
So we add “Microsoft Graph” packages in our application and follow the Microsoft tutorial (App-only authentification).
We have succeeded to create a new calendar inside the Admin calendar and share it to the user (he receive an email to subscribe on the new calendar). But this user can’t access to the event created inside the new calendar.
This is the different step we did to implement the API:
1- We create a Microsoft 365 Account
2- Create a new app on the Azure Directory admin center and add Microsoft Graph permissions
3- Create a secret and add it in our application
4- Call the Calendar API in our application to:
⁃ Create a calendar on the Admin Calendar
⁃ Create calendar permissions that permit to the user to access on the Admin Calendar : an invitation is sent by mail to the user to access to the new Admin calendar
⁃ We create a new event on the Admin Calendar. This event doesn’t appear on the user calendar : we have a problem to get events from the Admin Calendar to the user Calendar.
This is the code to delegate permissions to access to the calendar
CalendarPermission calendarPermission = new CalendarPermission
{
EmailAddress = new EmailAddress
{
Name = "NewCalendar",
Address = employeeEmail
},
IsInsideOrganization = true,
IsRemovable = true,
AllowedRoles = new[]
{
CalendarRoleType.Read,
CalendarRoleType.FreeBusyRead,
CalendarRoleType.LimitedRead
},
Role = CalendarRoleType.Read
;
var task = graphServiceClient.Users[userId].Calendars[calendarId].CalendarPermissions.Request().AddAsync(calendarPermission);
Hi @Mdx
Thank you for your question. Are you having issues when:
Hi @msft-gu,
Thank you for your response.
We are having the issue when we’re using the SDK.
Today we got a little progress. When we share a calendar (A) with some events already created in it and in the future, they are visible in the calendar (B). But if we create a new event in the calendar (A), we will not have the event visible on the calendar (B). All is donne by development.
We are not sure, but maybe it’s due to the rights on the Calendar Permission ? Or the configuration inside Azure Directory ?
CalendarPermission calendarPermission = new CalendarPermission
{
EmailAddress = new EmailAddress
{
Name = "NewCalendar",
Address = employeeEmail
},
IsInsideOrganization = true,
IsRemovable = true,
AllowedRoles = new[]
{
CalendarRoleType.Read,
CalendarRoleType.DelegateWithoutPrivateEventAccess,
CalendarRoleType.DelegateWithPrivateEventAccess,
CalendarRoleType.FreeBusyRead,
CalendarRoleType.LimitedRead
},
Role = CalendarRoleType.Read
};
var task = graphServiceClient.Users[userId].Calendars[calendarId].CalendarPermissions.Request().AddAsync(calendarPermission);