I am trying to get the list of meetings from a room shared calendar using Microsoft Exchange (EWS) API and it's returning this error: No mailbox with such guid

var service = new ExchangeService();service.Credentials = new NetworkCredential("username", "password");service.Url = new Uri("exchangeUrl");var startDate = DateTime.Today;var endDate = DateTime.Today.AddDays(1);var cv = new CalendarView(startDate, endDate);var mailboxToAccess = "[email protected]";var calendarFolderId = new FolderId(WellKnownFolderName.Calendar, mailboxToAccess);var appointments = service.FindAppointments(calendarFolderId, cv); // << Exception happens here

Any ideas what could be wrong?

2

Best Answer


Make sure that the user that you're using in

service.Credentials = new NetworkCredential("username", "password");

is a licensed user, with their own mailbox, that has been granted access to the Shared Mailbox in question.

Use this, if you're trying to access Outlook mail box from an application end.
Language:C#

service.Credentials = new NetworkCredential("username", "password"); service.Url = new Uri("https://outlook.office365.com/EWS/Exchange.asmx");