title: How to upload files using folder path and Microsoft Graph API 1.0
body: <p>I am working on a script to upload files to a folder using Microsoft Graph API 1.0. I am trying to make it so the user running the script can copy and paste the path of a sharepoint/onedrive folder. I of course want to use the path as a destination for the files to be uploaded too. So far I cannot find a way to get this to work.</p>
  <p>Path example: <a href="https://example.sharepoint.com/sites/TheSite/Shared%20Documents/User" rel="nofollow noreferrer">https://example.sharepoint.com/sites/TheSite/Shared%20Documents/User</a></p>
  <p>API Reference: <a href="https://docs.microsoft.com/en-us/graph/api/resources/driveitem?view=graph-rest-1.0" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/graph/api/resources/driveitem?view=graph-rest-1.0</a></p>
  <p>I have tried making GET calls to the API using the path, part of the path, and every variation of the hostname, and path. I am using the Python Requests library, and authentication is not an issue.</p>
  <p>Errors received:</p>
  <pre><code> &quot;error&quot;: {
      &quot;code&quot;: &quot;itemNotFound&quot;,
      &quot;message&quot;: &quot;The resource could not be found.&quot;
  </code></pre>
  <p>and</p>
  <pre><code>  &quot;error&quot;: {
      &quot;code&quot;: &quot;invalidRequest&quot;,
      &quot;message&quot;: &quot;Invalid hostname for this tenancy&quot;,
  </code></pre>