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.
Path example: https://example.sharepoint.com/sites/TheSite/Shared%20Documents/User
API Reference: https://docs.microsoft.com/en-us/graph/api/resources/driveitem?view=graph-rest-1.0
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.
Errors received:
"error": {
"code": "itemNotFound",
"message": "The resource could not be found."
and
"error": {
"code": "invalidRequest",
"message": "Invalid hostname for this tenancy",