Search code examples
c#outlookmicrosoft-graph-apiexchangewebservices

Retrieve SingleValueExtendedProperties with MS-Graph API created with EWS


My application sync events between Exchange in Office 365 and my database. For now I use EWS and I add extended properties (ExtendedProperties) to save some custom data. Since several weeks the sync doesn't work anymore. A ticket is opened at Microsoft but without solution. So I want to replace EWS by MS-Graph API and do the same things.

For each event I have one extended properties created like that : new ExtendedPropertyDefinition(myGUID, "customName", MapiPropertyType.String);

And 3 extended properties created like that : new ExtendedPropertyDefinition(DefaultExtendedPropertySet.PublicStrings, "customName", MapiPropertyType.String)

With MS-Graph API, I can get the first because I have a GUID but I not find the expand/filter request for the 3 others

https://graph.microsoft.com/v1.0/users/xxxx@xxx.com/events/AAMkAAAAENAADrikE09bj2T7c3PGHoeoTWAASW=?$expand=singleValueExtendedProperties($filter=Id eq 'String {myGUID} Name customName')

Can someone help me with the request to get the others extended properties with singleValueExtendedProperties filter ?

If I change the filter format the response is : 'MapiPropertyType namespaceGuid Name propertyName', 'MapiPropertyType namespaceGuid Id propertyId' or 'MapiPropertyType propertyTag'."


Solution

  • The Guid for PublicStrings is 0020329-0000-0000-c000-000000000046 so just using that and a Or Statement should work eg

    $expand=SingleValueExtendedProperties(=(Id eq 'Binary 0x3019') or (Id eq 'Integer 
    0x301D') or 
    (Id eq 'Integer 0x301A') or (Id eq 'Binary 0x301B') or (Id eq 'SystemTime 0x301C') or 
    (Id eq 'String {403FC56B-CD30-47C5-86F8-EDE9E35A022B} Name ComplianceTag') or (Id eq 
    'Binary 0x348A')