How to use receivedDateTime in Graph API Request?

I am trying to use the receivedDateTime filter clause when calling the Graph API, but I’m running into issues when I use the exact datetime. For example, when I try running this API call:

GET$filter=receivedDateTime ge '2022-05-23T12:29:00'&$orderby=receivedDateTime%20ASC&$top=100&$skip=0

I get a 400 bad request (the specific error mentions "bad filter clause"). But it works when I run this one:

GET$filter=receivedDateTime ge 2022-05-23'&$orderby=receivedDateTime%20ASC&$top=100&$skip=0

What can I do if I want to use the exact datetime in the filter clause, or is this even possible?

>Solution :

You need to append the Z in the ISO 8601 time format, where Z represents the zone designator for the zero UTC offset. (e.g. 2022-05-23T11:59:59Z)$filter=receivedDateTime ge 2022-05-23T11:59:59Z

Leave a Reply