EWS update appointment while using impersonation fails saying that access is denied RRS feed

  • Question

  • Hi, I have the following issue and I was hoping that someone here could help me with this. I am developing an app where I use soap requests to communicate with the EWS, so fyi I am not using the EWS Managed API, but just pure EWS. 

    So when I create an event via my app, using impersonation (I use a service account X that impersonates a user Y, since I want to create the event in the Y user's calendar) it works well. When I try to update the event I created via my application also using impersonation like above, it works fine. However if I log on to office 365 online, and go to user Y's (impersonated user) calendar and create an event there, and then go into my app, pull the current bookings from his calendar and try to update one of those pulled bookings that were created in the online calendar, I get the access is denied error, specifically this:

    ('Access is denied. Check credentials and try again., Microsoft.Exchange.Data.Storage.AccessDeniedException: Cannot get ID from name.)

    Now this does not make sense to me because I am doing the same thing when I create the event from my application and from the calendar. When I create the event from my app I am using the service admin account to impersonate the user and create the event in his calendar, and when I create the event in the calendar I go to that user's calendar and create an event. To me that sounds like the same thing, right? 

    Then I tried another solution. Since there will always be a room involved in the event creation process, I tried only fetching the room events, and creating events on the room calendars for specific users, and then adding them as owners or participants. It also works well from my app, but if I create an event from the office calendar for a specific user and room, and if I try to update that event after I pull it into the application, there is no error, but the event only gets updated in the room's calendar, it does not send a notification that the event is updated to the owner's or the participant's calendar, so their event remain the same.

    Any help is appreciated..

    Tuesday, December 22, 2015 9:20 AM

All replies

  • I am facing the same issue when using UploadItems  operation but only for certain malboxes. Any help?
    Wednesday, May 10, 2017 6:38 AM