You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using this library in my project to retrieve emails from my mailbox. However, when I try to filter messages from my mailbox by createdDateTime I get a "Bad Request" error. Here is my request:
private static IMailFolderMessagesCollectionPage GetMessages(string subject, int count) { return new graphServiceClient.Me.MailFolders.Inbox.Messages.Request().Filter($"subject eq '{subject}' and createdDateTime gt '{DateTime.Now.AddMinutes(-10)}'").Top(count).GetAsync().Result; }
Also, when I try to retrieve an email by its subject and body content - I can't get any message. Here is my request:
private static IMailFolderMessagesCollectionPage GetMessages(string subject, string bodyPart, int count) { return new graphServiceClient.Me.MailFolders.Inbox.Messages.Request().Filter($"subject eq '{subject}' and contains(body/content, '{bodyPart}')").Top(count).GetAsync().Result; }
Do the Microsoft Graph API and the library itself support filtering of emails(messages) by createdDateTime and body content? AB#10435
The text was updated successfully, but these errors were encountered:
I've constructed the desired query on Graph Explorer and got the similar results. There are no messages in reply. My query.
https://graph.microsoft.com/v1.0/me/mailFolders('Inbox')/messages?$filter=subject eq '*****' and contains(body/content, '****')&$top=10
Do I understand correctly that a construct like 'contains(body/content, '****')' verifies that the body contains the object I specified? And the whole body of the object shouldn't just consist of it?
As this functionality is not part of the client library, I have forwarded your question at the link below, so that the relevant API owners can help us understand if this is indeed expected behavior.
I am using this library in my project to retrieve emails from my mailbox. However, when I try to filter messages from my mailbox by createdDateTime I get a "Bad Request" error. Here is my request:
private static IMailFolderMessagesCollectionPage GetMessages(string subject, int count) { return new graphServiceClient.Me.MailFolders.Inbox.Messages.Request().Filter($"subject eq '{subject}' and createdDateTime gt '{DateTime.Now.AddMinutes(-10)}'").Top(count).GetAsync().Result; }
Also, when I try to retrieve an email by its subject and body content - I can't get any message. Here is my request:
private static IMailFolderMessagesCollectionPage GetMessages(string subject, string bodyPart, int count) { return new graphServiceClient.Me.MailFolders.Inbox.Messages.Request().Filter($"subject eq '{subject}' and contains(body/content, '{bodyPart}')").Top(count).GetAsync().Result; }
Do the Microsoft Graph API and the library itself support filtering of emails(messages) by createdDateTime and body content?
AB#10435
The text was updated successfully, but these errors were encountered: