EWS: calendar prompt and advanced properties

Ok, so far the best information I got regarding this topic was in this thread: EWS-API-Create-Calendar-and-Share-with-reviewer-permissions . I tried asking this question in this thread, but I actually posted it as an answer, so it was removed by the admins (mine is bad!)

DISCLAIMER: I am an administrator of trade and moonlight in development ... so please excuse any misuse of terminology or wording confusion.

Also, I am working in C # here fyi.

I read the message protocol specs from microsoft and realized that it is necessary to create certain extended properties on the message element in order to properly create the invite object to share, which I understand from the above post, I can create a message object with extended properties ( SetExtendedProperty(extprop,value)

to be precise) ... I understand that I have to manually create the extended properties that I set with new ExtendedProperty()

and fill in the correct Parent GUID, HexID, and Datatype for each property. From what I can gather, this is more or less a "workaround" for the lack of inherent sharing object management capabilities built into the API ...

But I ran into a problem and need some clarification ...

I wanted to manually create a sharing invitation (via client, user path) and then attach the user who sent the invitation to the message in the Sent Items field. I wanted to list all the possible properties as to what I need to use to create a similar object so that I can use it as a template and compare the properties of my objects to the original prompt. I can get the message ok and find many properties, but not "special" ones. The only thing I can find to distinguish a post item is the fact that it is IPM.Sharing

an item class and that it has an attachment sharing_metadata.xml


But can I assume that we can now create co-shared invitations via the API using extended properties, which doesn't necessarily mean that we can read those properties via the API?

Everything I've tried to list extended properties doesn't seem to work and always returns nothing instead of an array of extended properties. I may not be doing it right, but I wanted to ask a question before spending countless hours trying to achieve something that is not possible.

So, if I can't list the extended properties correctly, is there a way to use something like ExFolders


or something to get those properties.

Any thoughts / suggestions / criticisms?



Here is the function I'm playing with to try and create a sharing invitation for the calendar folder for users ... I commented where I got stuck and that I didn't wrap my head around completely:

    public void CreateCalendarSharingRequest(string folderID, string owner, string sharedToUser)
        Guid PropertySetSharing = new Guid("{00062040-0000-0000-C000-000000000046}");
        Guid PropertySetInternetHeaders = new Guid("{00020386-0000-0000-C000-000000000046}");

        // Sharing Properties
        ExtendedPropertyDefinition PidLidSharingProviderGuid = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A01, MapiPropertyType.CLSID);
        ExtendedPropertyDefinition PidLidSharingProvidorName = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A02, MapiPropertyType.String);
        ExtendedPropertyDefinition PidLidSharingFlavor = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A18, MapiPropertyType.Integer);
        ExtendedPropertyDefinition PidLidSharingRemoteStoreUid = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A48, MapiPropertyType.String);
        ExtendedPropertyDefinition PidLidSharingRemoteUid = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A06, MapiPropertyType.String);
        ExtendedPropertyDefinition PidTagMessageClass = new ExtendedPropertyDefinition(0x001A, MapiPropertyType.String);
        ExtendedPropertyDefinition PidTagNormalizedSubject = new ExtendedPropertyDefinition(0x0E1D, MapiPropertyType.String);
        ExtendedPropertyDefinition PidTagSubjectPrefix = new ExtendedPropertyDefinition(0x003D, MapiPropertyType.String);
        ExtendedPropertyDefinition PidLidSharingCapabilities = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A17, MapiPropertyType.Integer);
        ExtendedPropertyDefinition PidLidSharingInitiatorEntryId = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A09, MapiPropertyType.Binary);
        ExtendedPropertyDefinition PidLidSharingConfigurationUrl = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A24, MapiPropertyType.String);
        ExtendedPropertyDefinition PidLidSharingInitiatorName = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A07, MapiPropertyType.String);
        ExtendedPropertyDefinition PidLidSharingInitiatorSMTP = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A08, MapiPropertyType.String);
        ExtendedPropertyDefinition PidLidSharingLocalType = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A14, MapiPropertyType.String);
        ExtendedPropertyDefinition PidLidSharingRemoteType = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A1D, MapiPropertyType.String);
        ExtendedPropertyDefinition PidLidSharingRemoteName = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A05, MapiPropertyType.String);

        // Internet Header Properties
        ExtendedPropertyDefinition PidNameContentClass = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "Content-Class", MapiPropertyType.String);
        ExtendedPropertyDefinition PidNameXSharingCapabilities = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Capabilities", MapiPropertyType.String);
        ExtendedPropertyDefinition PidNameXSharingConfigUrl = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Config-Url", MapiPropertyType.String);
        ExtendedPropertyDefinition PidNameXSharingFlavor = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Flavor", MapiPropertyType.String);
        ExtendedPropertyDefinition PidNameXSharingLocalType = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Local-Type", MapiPropertyType.String);
        ExtendedPropertyDefinition PidNameXSharingRemoteName = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Remote-Name", MapiPropertyType.String);
        ExtendedPropertyDefinition PidNameXSharingRemoteStoreUid = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Remote-Store-Uid", MapiPropertyType.String);
        ExtendedPropertyDefinition PidNameXSharingRemoteType = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Remote-Type", MapiPropertyType.String);
        ExtendedPropertyDefinition PidNameXSharingRemoteUid = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Remote-Uid", MapiPropertyType.String);
        ExtendedPropertyDefinition PidNameXSharingProviderGuid = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Provider-Guid", MapiPropertyType.String);
        ExtendedPropertyDefinition PidNameXSharingProviderName = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Provider-Name", MapiPropertyType.String);

          // Bind to the web services and currently selected folder
        // Get the current list of delegates for this folder
        ExchangeService service = GetExchangeService();

        // Create a new message
        EmailMessage invitationRequest = new EmailMessage(service);
        invitationRequest.Subject = "I'd like to share my calendar with you";
        invitationRequest.Body = "Send by Exchange Administrator on behalf of user";
        invitationRequest.From = GetSMTPAddress(owner);
        invitationRequest.ItemClass = "IPM.Sharing";
        invitationRequest.SetExtendedProperty(PidNameContentClass, "Sharing");
        invitationRequest.SetExtendedProperty(PidTagMessageClass, "IPM.Sharing");
        invitationRequest.SetExtendedProperty(PidLidSharingFlavor,0x20310); /* Indicates Invitation for a special folder */
        invitationRequest.SetExtendedProperty(PidNameXSharingFlavor, "20310"); /* Text representation of SharingFlavor value */
        invitationRequest.SetExtendedProperty(PidLidSharingProviderGuid, PropertySetSharing.ToString());
        invitationRequest.SetExtendedProperty(PidNameXSharingProviderGuid, PropertySetSharing.ToString());
        invitationRequest.SetExtendedProperty(PidLidSharingCapabilities, 0x40290); /* value for Special Folders */
        invitationRequest.SetExtendedProperty(PidNameXSharingCapabilities, "40290"); /* Test representation of SharingCapabilities value */

        // THIS IS WHERE IM STUCK - I understand how to set some of the properties like above, but then
        // it starts needing the entryID properties for the folder being shared, etc...and I'm not entirely
        // sure which properties I have to set and how many can/will be autopopulated by the transport provider
        // All i wanna do is send an invite message for sharing the calendar folder from one user to another!

        // Add recipient info





source to share

1 answer

Ok, I figured it out ... but it wasn't easy. If you are interested in how I managed to get the sharing invitation sent via Exchange 2010 EWS API 1.2, you can read about it here



All Articles