title: Is it possible to subscribe push notifications for Exchange room resource calendar
body: <p>We have an existing implementation that subscribes via EWS Managed API push notifications for a user's calendar in Office 365 Exchange Online.</p>
  
  <pre><code>PushSubscription pushSubscription = exchangeService.SubscribeToPushNotifications(
      new FolderId[] { WellKnownFolderName.Calendar },
      new Uri(callbackEndpoint), statusFrequency, null,
      EventType.Created, EventType.Deleted, EventType.Modified,
      EventType.Moved, EventType.Copied, EventType.FreeBusyChanged);
  </code></pre>
  
  <p>Other than the <a href="https://stackoverflow.com/questions/27976614/exchange-online-push-notification-subscription-unable-to-perpetuate">subscription not being able to last forever</a>, it is otherwise fine; appointments scheduled on the calendar do send notifications to our web service.</p>
  
  <p>Now instead of monitoring events from a user's mailbox perspective, we are wondering if it is possible to subscribe from the room resource mailbox perspective.</p>
  
  <pre><code>// Set room mailbox address.
  exchangeService.ImpersonatedUserId = new ImpersonatedUserId(ConnectingIdType.SmtpAddress, roomAddress);
  
  PushSubscription pushSubscription = exchangeService.SubscribeToPushNotifications(
      new FolderId[] { WellKnownFolderName.Calendar },
      new Uri(callbackEndpoint), statusFrequency, null,
      EventType.Created, EventType.Deleted, EventType.Modified,
      EventType.Moved, EventType.Copied, EventType.FreeBusyChanged);
  </code></pre>
  
  <p>Unfortunately it does not turn out to be so simple,</p>
  
  <blockquote>
    <p>The request failed. The remote server returned an error: (457)
    <a href="https://autodiscover-s.outlook.com/owa/domain.onmicrosoft.com" rel="nofollow noreferrer">https://autodiscover-s.outlook.com/owa/domain.onmicrosoft.com</a>.</p>
  </blockquote>
  
  <p>I cannot find any in-depth material explaining what error 457 truly is, and how to overcome this problem.</p>
  
  <p>Additionally, I have not found anybody else attempting subscriptions to resource mailboxes. Is it because it is outright impossible, or simply nobody ever found a need to?</p>
  
  <p>UPDATE</p>
  
  <p>Tried using the <a href="https://ewseditor.codeplex.com/" rel="nofollow noreferrer">EWSEditor tool</a> to see what kinds of extra detail can be sniffed out; seems like impersonating a room mailbox requires some sort of special permission.</p>
  
  <blockquote>
    <p>Exception details: Message: The account does not have permission to
    impersonate the requested user. Type:
    Microsoft.Exchange.WebServices.Data.ServiceResponseException Source:
    Microsoft.Exchange.WebServices ErrorCode: ErrorImpersonateUserDenied
    ErrorMessage: The account does not have permission to impersonate the
    requested user. Stack Trace:    at
    Microsoft.Exchange.WebServices.Data.ServiceRequestBase.ProcessWebException(WebException
    webException)    at
    Microsoft.Exchange.WebServices.Data.ServiceRequestBase.GetEwsHttpWebResponse(IEwsHttpWebRequest
    request)    at
    Microsoft.Exchange.WebServices.Data.ServiceRequestBase.ValidateAndEmitRequest(IEwsHttpWebRequest&amp;
    request)    at
    Microsoft.Exchange.WebServices.Data.MultiResponseServiceRequest 1.Execute()
    at
    Microsoft.Exchange.WebServices.Data.ExchangeService.InternalConvertIds(IEnumerable 1
    ids, IdFormat destinationFormat, ServiceErrorHandling errorHandling)<br>
    at
    Microsoft.Exchange.WebServices.Data.ExchangeService.ConvertIds(IEnumerable 1
    ids, IdFormat destinationFormat)    at
    EWSEditor.Common.Extensions.ExchangeServiceExtensions.TestExchangeService(ExchangeService
    service)</p>
  </blockquote>
  
  <p>I tried assigning Full access for mailbox delegation in the Office 365 admin interface, but that did not appear to do any favours.</p>