title: Obtain unread Outlook messages using O365 library
body: <p>I am building a small program to resend email from one outlook account to others, in Python.
  After doing some research, I found the <a href="https://pypi.org/project/O365/" rel="nofollow noreferrer">O365 library</a>.</p>
  
  <p>I have managed to log in, and now I am building a query to obtain the unread messages. Based on the documentation, the filtering is using Open Data Protocol (OData).</p>
  
  <pre class="lang-py prettyprint-override"><code>from O365 import Account
  
  credentials = ('client_id', 'secret')
  scopes = ['scopes_selected']
  
  account = Account(credentials) #Login
  
  mailbox = account.mailbox() #access mailbox
  
  inbox = mailbox.inbox_folder() #access inbox folder
  query = mailbox.new_query().on_attribute('isRead').equals('false') #get unread messages
  for message in inbox.get_messages(query=query):
      print(message)
  </code></pre>
  
  <p>The error I get is:</p>
  
  <pre><code>Client Error: 400 Client Error: Bad Request for url: https://graph.microsoft.com/v1.0/me/mailFolders/Inbox/messages?%24top=25&amp;%24filter=isRead+eq+%27false%27 | Error Message: Invalid filter clause
  </code></pre>
  
  <p>I am aware that the URL the library creates is not correct, maybe because 'isRead' is not an attribute, but I have not managed to discover what it is.</p>
  
  <p>Also, if I use the Graph tool offered by <a href="https://developer.microsoft.com/en-us/graph/graph-explorer" rel="nofollow noreferrer">Microsoft</a>, this query works:</p>
  
  <p><code>https://graph.microsoft.com/v1.0/me/mailFolders/Inbox/messages?$filter=isRead eq false</code></p>