I need a Microsoft graph API query to retrieve mails based on from email filter & contains a particular word.
There are ready API's to do these thing individually.
To retrieve mails based on from - email address:
https://graph.microsoft.com/v1.0/me/messages?$filter=(from/emailAddress/address) eq 'member_services@outlook.com'
To retrieve mails based on a search term
https://graph.microsoft.com/v1.0/me/messages?$search=get
But I need a query that does the both together.
I tried combining them with '&' but it's not working.
https://graph.microsoft.com/v1.0/me/messages?$search=get&$filter=(from/emailAddress/address) eq'member_services@outlook.com'
This query is giving bad request error.
Please help me with a proper query that works.
You are missing space after eq
operator but it's not important because the query parameter $filter
is not supported with $search
.
You can use only $search
and specify from
and the term like this
https://graph.microsoft.com/v1.0/me/messages?$search="from:member_services@outlook.com AND get"
Resources: