Unable to filter messages by recipient in Microsoft Graph Api. One or more invalid nodes

Related searches

I am trying to get a list of messages that are filtered by recipient from Microsoft Graph API. The url I am using for the request is:

https://graph.microsoft.com/beta/me/messages?$filter=toRecipients/any(r: r/emailAddress/address eq '[Email Address]')

But I am getting this is the response:

{
   "error": {
        "code": "ErrorInvalidUrlQueryFilter",
        "message": "The query filter contains one or more invalid nodes.",
        "innerError": {
            "request-id": "7db712c3-e337-49d9-aa8d-4a5d350d8480",
            "date": "2016-09-28T16:58:34"
        }
    }
}

A successful request should look like this (with a lot more data that I have omitted).

{
    "@odata.context": "https://graph.microsoft.com/beta/$metadata#users('99999999-9999-9999-9999-999999999999')/messages",
    "@odata.nextLink": "https://graph.microsoft.com/beta/me/messages?$skip=10",
    "value": [
        {
            "toRecipients": [
                {
                    "emailAddress": {
                        "name": "[Name]",
                        "address": "[Email Address]"
                    }
                }
            ],
        }
    ]
}

The request works if I remove the filter, and I am able to perform requests with simpler filters.

Is there a problem with my URL, or is there another way to make the request?

After several hours looking for the solution, I found in the office365 documentation that the property toRecipients is not filterable:

https://msdn.microsoft.com/en-us/office/office365/api/complex-types-for-mail-contacts-calendar#MessageResource

I guess that it's the same in the graph api. So the only solution is using search.

microsoftgraph/microsoft-graph-docs, Unable to filter messages by recipient in Microsoft Graph Api. One or more invalid nodes. 9月. 22. 2019. By 蓝咒. I am trying to get a list of messages that are� Unable to filter messages by recipient in Microsoft Graph Api. One or more invalid nodes (2) I am trying to get a list of messages that are filtered by recipient from Microsoft Graph API. The url I am using for the request is:

Another way to make the request might be to not use filter and use search instead, depending on exactly what you want (and you may have already tried this):

https://graph.microsoft.com/beta/me/messages?$search="to:[Email Address]"

Unable to filter with endswith � Issue #4331 � microsoftgraph , filter=emailAddresses/any(a:startswith(a/address,'user')) But this returns the following error: "message": "The query filter contains one or more invalid nodes . According to the underlying Outlook API documentation, the� 21 Unable to filter messages by recipient in Microsoft Graph Api. One or more invalid nodes One or more invalid nodes 17 The program '[13492] dotnet.exe' has exited with code -2147450749

Your filter seems correct according to this OData Basic Tutorial

They have the below filter example which is also querying a complex data type so you do seem to have the correct way.

serviceRoot/Me/Friends?$filter=Friends/any(f:f/FirstName eq 'Scott')

Going back to Microsoft Graph, the below query does work so I can only assume that querying complex data types is broken.

https://graph.microsoft.com/v1.0/me/messages?$filter=categories/any(c: c eq 'test')

Not an answer but probably just confirming what you've experienced.

Use query parameters to customize responses, To filter Microsoft Graph API responses, the docs suggest to use the filter " message": "The query filter contains one or more invalid nodes. Impossible de filtrer les messages par destinataire dans L'Api Microsoft Graph. Un ou plusieurs noeuds invalides j'essaie d'obtenir une liste de messages filtrés par le destinataire à partir de L'API Microsoft Graph.

Known issues with Microsoft Graph, A Microsoft Graph API operation might support one or more of the double escaped; otherwise, the request will fail due to invalid syntax. GET https://graph .microsoft.com/v1.0/me/messages?$filter=subject eq 'let''s meet for lunch?' received, The date that an email message was received by a recipient. 21 Unable to filter messages by recipient in Microsoft Graph Api. One or more invalid nodes Sep 28 '16 17 The program '[13492] dotnet.exe' has exited with code -2147450749 Jul 14 '18

For information about the latest updates to the Microsoft Graph API, see the Microsoft fails with the following error code when an organization has several The recipient re-accepts the shared calendar using Outlook on the web. to an Outlook message or event that is in a shared or delegated mailbox. 5 Unable to filter messages by recipient in Microsoft Graph Api. One or more invalid nodes Nov 7 '16. 4 Microsoft Graph not returning messages with a date filter Mar

3 Unable to filter messages by recipient in Microsoft Graph Api. One or more invalid nodes Oct 6 '16 3 Elasticsearch query_string query with multiple default fields Dec 28 '17

Comments
  • There is definitely something wrong with your $filter parameter. What exactly are you trying to get with your filter?
  • I am trying to get a list of all messages that were sent to a specific email address.
  • This definitely looks like a bug, I just spend half day before deciding to go with search. Should've checked here first :(. Exists in Outlook Rest api v1.0 and v2.0 as well. I couldn't find a place to log it though. Anybody knows how to log it?
  • Documentation: developer.microsoft.com/en-us/graph/docs/concepts/…