cannot add more than 15 filter conditions

Roshan API Test 0 Reputation points
2024-06-24T13:14:00.89+00:00

i'm trying to list all user emails using the "https://graph.microsoft.com/v1.0mailFolders/inbox/messages" endpoint. my requirement is want to get only emails from selected domains and ignore emails from some selected email addresses. but as of now when i add more than 10 emails in the filter parameter, its showing error. how to do this?

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,268 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Yakun Huang-MSFT 1,950 Reputation points Microsoft Vendor
    2024-06-25T02:38:31.95+00:00

    Hi @Roshan API Test

    According to the Graph API, the $filter query parameter clause is limited to 15 expressions by default, and if you need to add more expressions, you can use the advanced query, which adds the parameter ConsistencyLevel: eventual to the request header

    User's image

    See this link for more details:

    https://video2.skills-academy.com/en-us/graph/aad-advanced-queries?tabs=http

    Hope this helps.

    If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.