18 comments on “Understanding Sharing Invitation Requests – EWS Managed API 1.2 : Part 2

  1. Have you ever considered writing an e-book or
    guest authoring on other websites? I have a blog centered on the
    same topics you discuss and would really like to have you share some stories/information.
    I know my readers would appreciate your work. If you are even remotely interested, feel free to shoot me an email.

  2. Hi
    I am trying to use your code to do the following: I have a shared calendar and want to automatically have the calendar published ( as an overlay ) in another user’s calendar. Can you help please?

    • If I understand your wanting outlook to show a shared calendar in an overlay? Or in OWA? Off the top of my head that seems an altogether different issue, like you’d have to use the local apis available from the Microsoft libraries to do something like that instead of EWS…I could be wrong but I think that’s more the direction you want to go…

      • Koomar says:

        Hi
        We are looking to have overlay in OWA.
        Here is the scenario :
        A user has a calendar that he/she wants to share with another user (or group). We want to have this sharing done automatically by clicking a button on a website. The code should be able to share the calendar automatically without the approval of the recipient. [ Out of the box : a user need to go to outlook and send a sharing invitation that the recipient need to accept]…we want to skip that. Instead have the code automatically share the calendar and publish it in his calendar as a shared a calendar.

        Thanks

      • You’ll need a service account running for the web app that has the ability to impersonate in Exchange..one process would create the invitation and maybe pass the message id to the second process that will need to login as the recipient and accept the invitation programmatically. I never got that far (automating the acceptance) so let me do some research and I’ll try to comment back in a day or two to let u know what I’ve found

      • Koomar says:

        Hi
        Thanks for your help…will your code works with Office 365?

      • That I’m unsure of…I’ve only done this through an on premise install, nothing federated. In theory it should but I’m unsure of any specific constraints on the office 365 EWS APIs and what u can/can’t do

  3. […] ← Thanks for visiting!! Understanding Sharing Invitation Requests – EWS Managed API 1.2 : Part 2 → […]

  4. Shyam says:

    Hi
    I created an sample based on your example but i’m getting an error of
    “The sharing message is not supported”.
    i’m using ews managed api 2.0 and exchange 2013 version.
    Any help is appreciated.

  5. Naresh says:

    Hi
    I created an sample based on your example but i’m getting an error of
    “internal server occurred.the operation failed”. and i tried without attaching sharing metadata file it was sent successfully but at the receiver end it shows as “the sharing message is not valid. All action buttons have been disabled”.

    any help is appreciated.

    • Naresh…so as I understand it the message sends with the xml attachment but says it’s invalid, and you’ve tried without but run into it also not functioning as intended?

      It’s been a while…but I know I never got it to work without the attached xml file. I know a previous commenter stated he got it working but I never revisited that myself. I would focus on the validity of the xml file. By that I mean check to see if the xml file generated is not being encoded properly or has an extra carriage return or is otherwise malformed.

      Part of my code shows I had issues with my xml files because I had to put a chunk of code in that removed two extra bytes being “prepended” to my file for whatever reason. Maybe you add/remove that block of code and rerun your tests to see if anything changes?..sorry I’m trying to remember as it’s been a while but if you get any more specific errors let me know.

    • One more thing I remember is the case sensitivity of the files xml tags. That gave me a huge headache so I would manually build your xml out (copying the exact strings from Ur code) and examine if the tags don’t match up with case or a close tag. (And after rereading my post – it was the attachment of the xml that caused me issues, not the xml itself. I had to force it through a filestream to encode properly)

  6. Nick Gelotte says:

    I have created what I think is a copy of you code and it runs but I am getting errors from the EWS service when I try to send the email or if I fiddle with it I can get it to send but then the email client says it is invalid. I am using Office 365 so I don’t have access to the servers but I was wondering – how did you collect the information about the sharing email to compare with? you mention owa and outlookspy but I have not figured out how to look at a valid sharing email and compare it to what I am creating. Do you any more information on how you captured this information?

    • Thanks for checking the post out Nick! To be honest its been a while since I dabbled with the Exchange API so ill go back through my notes and hopefully have an answer for you in the next day or two (crammed schedule tomorrow) – but i will definately let you know what I find!

    • Nick,

      This is being pieced together from memory and notes – so I am hoping it puts you in the right direction but I can’t guarantee I didn’t miss something:

      To examine a message I sent a sharing invitation to another mailbox I had control over, and from OutlookSpy you can look at the “IMessage” information, and also from the “IMessage” window you can click the “GetNamesFromIDs()” button and see a lot of the properties I talked about in the blog.

      Attached a couple images that show where I’m talking about in the UI with OutlookSpy

      For OWA all I can think of is that I exported the invite from OWA to a msg file and opened it from OutlookSpy in the client. Not sure if that’s 100% it or if I used the another MAPI Editor/Viewer – but I do see the properties with OutlookSpy.

      I hope that points you in the right general direction.

      Cheers

      Image 1: Select a message, then from Outlook Spy click “IMessage”:
      Image 1

      Image 2: Clicking “GetNamesFromIDs()” and viewing extended properties of the message from there:
      Image 2

      • Nick Gelotte says:

        I got it working – thanks so much for you help. I played around with matching up a lot of properties using outlookspy but in the end the thing that made the difference is that the binSharingProviderGuid that you have did not match what OWA was using. The guid that worked for me is 0006f0ae-0000-0000-c000-000000000046. Once I change that out things started working. I ended up not using the attachment as it was not needed with Office 365 I just had to add all the extended properties.

  7. Nick Gelotte says:

    Thanks – That is what I needed. I found a few differences and I am closer I will let you know how it goes.

  8. Aleman says:

    Adding this value in the extended property definition,
    Guid binSharingProviderGuid = new Guid(“{AEF00600-0000-0000-C000-000000000046}”);
    make the outlook2007 to fail.
    Otherwise, adapting the code it works Fine.

Leave a reply to mikewillcode4food Cancel reply