问题
My clients shared some onedrive folder with me which contains 5 Files, I want to find the drive-Id, File-Id, so that I can download using python scripts, Script reference: Not able to download files from inside folder, OneDrive, Microsoft Graph, Python
I am trying below script:
requests.get('https://graph.microsoft.com/v1.0/me/drive/sharedWithMe', headers={'Authorization': 'Bearer ' + Access_Token}).content
requests.get('https://graph.microsoft.com/v1.0/me/drives', headers={'Authorization': 'Bearer ' + Access_Token}).content
but I am getting my files details only.
回答1:
You can call the uri https://graph.microsoft.com/v1.0/me/drive/sharedWithMe
first and get the response data. In the response, we can find the id
and driveId
(the "driveId" is under "remoteItem" -> "parentReference") of the shared file. And then use the api below to download its content.
https://graph.microsoft.com/v1.0/me/drives/{driveId}/items/{id}/content
来源:https://stackoverflow.com/questions/61700031/find-the-shared-with-me-folder-id-drive-id-and-files-id-onedrive-microsof