0

Our goal here is to get the emails of the specific users within a specific received date time and lists only the following mail properties:

from, toRecipients, ccRecipients, bccRecipients

Here's the query that we ran

https://graph.microsoft.com/v1.0/users/user1@contoso.com/messages$select=from,toRecipients,ccRecipients,bccRecipients$filter=ReceivedDateTime ge 2019-07-01 and receivedDate lt 2019-07-02

https://graph.microsoft.com/v1.0/users/user1@contoso.com/messages$select=from,toRecipients,ccRecipients,bccRecipients$filter=ReceivedDateTime ge 2019-07-01 and receivedDate lt 2019-07-02

Error:

{
    "error": {
        "code": "ErrorFolderNotFound",
        "message": "The specified folder could not be found in the store.",
        "innerError": {
            "request-id": "8b58633d-3e7f-4e25-a6bc-bd1562340bc4",
            "date": "2019-07-30T15:11:12"
        }
    }
}
ThanhPhanLe
  • 1,315
  • 3
  • 14
  • 25

1 Answers1

0

Your query link has a couple mistakes in it:

  1. Since $select and $filter attributes are a part of the URL query string, they must be preceded by ?
  2. $filter is a separate parameter from $select, so they must be separated by &
  3. The selected/filtered attributes must match exactly to what the API supplies, including case (you wrote "ReceivedDateTime" and "receivedDate", both of which should be "receivedDateTime"

Here is the corrected URL: https://graph.microsoft.com/v1.0/users/user1@contoso.com/messages?$select=from,toRecipients,ccRecipients,bccRecipients&$filter=receivedDateTime ge 2019-07-01 and receivedDateTime lt 2019-07-02

For a list of all mail properties available, see the documentation

luke_g
  • 51
  • 4