title: Accessing Outlook API with Python
body: <p>How do you access the XML API with Python to create calendar events in a Microsoft Office 365 account?</p>
  
  <p>I have a hosted account on <a href="http://outlook.office365.com" rel="nofollow">http://outlook.office365.com</a>, and I'm trying to use the Python library <a href="https://github.com/linkedin/pyexchange" rel="nofollow">https://github.com/linkedin/pyexchange</a> (using the <a href="https://pyexchange.readthedocs.org/en/latest/" rel="nofollow">sample code</a> almost verbatim) to create calendar events, but Outlook refuses my credentials with the error, "Unable to connect to Exchange: HTTP Error 401: Unauthorized"</p>
  
  <p>I'm using the endpoint <a href="https://outlook.office365.com/EWS/Exchange.asmx" rel="nofollow">https://outlook.office365.com/EWS/Exchange.asmx</a>, with the username and password I normally use to login to the web UI.</p>
  
  <p>Do I need to specially setup or configure my account before I can access it from the API?</p>