You are not using the proper format for a receivedDateTime
value. Try this:
https://graph.microsoft.com/v1.0/users/{userId}/messages?$filter=receivedDateTime ge 2023-10-01T00:00:00z
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi everyone,
I am having difficulty in filtering messages based on the receivedDateTime
field while querying the Microsoft Graph API. I am aiming to retrieve messages for a particular user, filtered by a specific date.
However, I keep encountering a 400 Bad Request error whenever I include the ?$filter=receivedDateTime ge {date}
in the request URL.
Here's the exact URL format I've been trying:
https://graph.microsoft.com/v1.0/users/{user_id}/messages?$filter=receivedDateTime ge 2023-10-01T00:00:00
And the error I receive is:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<HTML><HEAD><TITLE>Bad Request</TITLE>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD>
<BODY><h2>Bad Request</h2>
<hr><p>HTTP Error 400. The request is badly formed.</p>
</BODY></HTML>
I have tried various date formats and url encodings. I am able to execute other queries without the filter successfully, so I believe the rest of my request setup is correct.
Can anyone provide insight on the correct way to format this filter, or point me to where in the documentation this is explained?
Thank you for your assistance!
You are not using the proper format for a receivedDateTime
value. Try this:
https://graph.microsoft.com/v1.0/users/{userId}/messages?$filter=receivedDateTime ge 2023-10-01T00:00:00z