Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement Request: Support for Multiple Conditions Queries in Microsoft Graph API Messages Endpoint #1613

Open
gangstabob opened this issue Feb 6, 2024 · 0 comments

Comments

@gangstabob
Copy link

Feature Request

Is your feature request related to a problem? Please describe

Currently, there is a limitation in the Microsoft Graph API where querying messages based on multiple conditions, such as messages received during a specific period and sent to a specific address, can be challenging.

Describe the solution you'd like

I would like to request an enhancement to the Microsoft Graph API that allows for more flexible and efficient querying of messages based on multiple conditions. Specifically, I would like to see the ability to perform queries like the following example:
https://graph.microsoft.com/v1.0/me/messages?$(filter=ReceivedDateTime ge 2023-06-01 and ReceivedDateTime le 2023-06-19 and ('[email protected]' in toRecipients))
This would enable users to filter messages based on both date ranges and specific recipient addresses in a single query.

Describe alternatives you've considered

Currently, the only alternative to achieve this is to use the $search parameter, as shown in the following example:
https://graph.microsoft.com/v1.0/me/messages?$search="to:[email protected] AND received>=2023-06-01 AND received<=2023-06-19"
However, using $search does not allow for the use of $count=true to determine the quantity of emails that fit the specified requirements. As a workaround, users may need to retrieve a limited set of fields (e.g., $select=id) and calculate the length of the returned JSON to approximate the count.

Additional context

The ability to perform multiple conditions queries in a single request would greatly enhance the usability and efficiency of the Microsoft Graph API for users who need to filter messages based on complex criteria. This feature would provide more flexibility and reduce the need for workarounds to achieve the desired results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant