Filtering multiple possible values with ExtendedProperties and Office 365 REST API

前端 未结 1 1102
独厮守ぢ
独厮守ぢ 2021-01-16 06:23

I am trying to get a list of emails given their InternetMessageID.

For one given InternetMessageID, I can retrieve the corresponding mail following the syntax provi

相关标签:
1条回答
  • 2021-01-16 06:49

    I just tried this as well, and I get a more informative error message:

    {
      "error": {
        "code": "ErrorInvalidUrlQueryFilter",
        "message": "The filter expression for $filter on property ExtendedProperty only allows 
                   [and] and [eq] operators. The equality can only be specified between 
                   'PropertyId' and a constant or 'Value' and a constant (for example: 
                   PropertyId eq 'value')."
      }
    }
    

    UPDATE: Checked with my engineering team, and this error refers to what is inside the ANY statement. You can't use OR in there. So to make this work, you need two separate ANY statements joined by an OR:

    https://outlook.office.com/api/beta/me/messages?$filter=
      SingleValueExtendedProperties/any(ep: ep/PropertyId eq 'String 0x1035' 
                                        and ep/Value eq 'someid@somedomain') or 
      SingleValueExtendedProperties/any(ep: ep/PropertyId eq 'String 0x1035' 
                                        and ep/Value eq 'otherid@otherdomain')
    
    0 讨论(0)
提交回复
热议问题