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.
解决方案
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