MS Graph API, Getting Error when user try to get Users message using filter

Saifali Sanadi 1 Reputation point
2021-10-12T05:18:45.377+00:00

Hello,

I'm trying to use the graph api to filter users messages using receivedDateTime and from/emailAddress/address.

when i call

https://graph.microsoft.com/v1.0/users/messages?$filter=receivedDateTime ge 2021-10-10 and (from/emailAddress/address) eq '******@notifications-tst09.companyname.com'

It gives me error
{
"error": {
"code": "Request_UnsupportedQuery",
"message": "The specified filter against a single entity is invalid.",
"innerError": {
"date": "2021-10-11T03:48:26",
"request-id": "96765477-884d-43bf-8aab-c5a9f46c62ca",
"client-request-id": "96765477-884d-43bf-8aab-c5a9f46c62ca"
}
}
}

Last week this call was working fine but not sure what happened ?
can you please help me to fix this issue ?

Thanks

Microsoft Security Microsoft Graph
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. CarlZhao-MSFT 46,371 Reputation points
    2021-10-12T07:40:15.01+00:00

    There seems to be something wrong with your URL. Do you want to filter the messages received by the user ******@notifications-tst09.companyname.com after 2021-10-10? You can modify it to:

    https://graph.microsoft.com/v1.0/users/******@notifications-tst09.companyname.com/messages?$filter=receivedDateTime ge 2021-10-10   
    

    If an Answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.