title: Error 400 when trying to extract data from sharepoint
body: <p>I am trying to extract xml data from a SharePoint site.
  I always get error 400. Here is my Python code.</p>
  <pre><code>import requests
  from office365.sharepoint.client_context import ClientContext
  from office365.runtime.auth.authentication_context import AuthenticationContext
  from office365.runtime.http.request_options import RequestOptions
  from office365.runtime.client_request import ClientRequest
  from office365.graph.graph_client import GraphClient
  
  app_settings = {
      'url': 'https://xxxxxxxx.sharepoint.com/sites/xxxxxxx',
      'client_id': 'xxxxxxx',
      'client_secret': 'xxxxxxxx',
  }
  
  context_auth = AuthenticationContext(url=app_settings['url'])
  context_auth.acquire_token_for_app(client_id=app_settings['client_id'], client_secret=app_settings['client_secret'])
  ctx = ClientContext(app_settings['url'], context_auth)
  token = context_auth.provider.token.accessToken
  
  
  headers = {&quot;Authorization&quot;: &quot;Bearer &quot; + token, &quot;Content-type&quot;: &quot;application/xml&quot;}
  request = requests.get(&quot;https://xxxxxxx.sharepoint.com/sites/xxxxxxx/_api/xxxxxx/xxxxx/xxxxx&quot;, headers=headers)
  </code></pre>
  <p>I don't understand what I am missing because my url seems to be correct, I can get a token, which seems to be valid and not expired. Moreover, the application I have created on the SharePoint site seems also to be correct. I have entered this code in the permission request XML:</p>
  <pre><code>&lt;AppPermissionRequests AllowAppOnlyPolicy=&quot;true&quot;&gt;
  &lt;AppPermissionRequest Scope=&quot;http://sharepoint/content/sitecollection&quot; Right=&quot;FullControl&quot; /&gt;
  &lt;/AppPermissionRequests&gt;
  </code></pre>
  <p>The strange thing is that I can access the lists and subsites data that is available on the SharePoint site, but not this background odata.</p>
  <p>Can someone help me please?</p>