Query reg filter in Graph API

Gomes, Sneal 21 Reputation points
2020-10-28T12:56:34.647+00:00

I want emails which are received before a particular date.

I use following : https://graph.microsoft.com/v1.0/users/*email*/mailfolders/Archive/messages?$filter=ReceivedDateTime lt 2020-04-01

I have manually checked the 'Archive' folder and there are many emails which are received before 2020-04-01.

My application will automatically run this query every 5 min.

While testing, I found that once the app started it run 12 times (1 hour) and also gave correct output, however all subsequent calls are giving NULL output.

I get following JSON response:
<?xml version = "1.0" encoding = "UTF-8"?>
<ns0:RESTOutput xmlns:ns0 = "xxx">
<StatusCode>200</StatusCode>
<msg></msg>
</ns0:RESTOutput>

Please suggest.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,827 questions
0 comments No comments
{count} votes

Accepted answer
  1. Deva-MSFT 2,266 Reputation points Microsoft Employee
    2020-10-29T20:15:54.227+00:00

    Locally i tried the above Graph API, it's working for me. I would try the following:

    • Have you cross checked the mailbox whether the archive folder contains the items against your above query filter (receiveddatetime) when you see NULL?
    • Outside of your code, can you repro the issue in Graph Explorer/POSTMAN as well?
    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

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.