我的客户与我共享了一些onedrive文件夹,其中包含5个文件,我想找到drive-Id,File-Id,以便我可以使用python脚本下载,脚本参考:无法从内部文件夹、OneDrive、Microsoft Graph、Python 下载文件 https://stackoverflow.com/questions/61695577/not-able-to-download-files-from-inside-folder-onedrive-microsoft-graph-python/61698658#61698658
我正在尝试下面的脚本:
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
但我只获取我的文件详细信息。
你可以调用urihttps://graph.microsoft.com/v1.0/me/drive/sharedWithMe
首先并获取响应数据。在响应中我们可以发现id
and driveId
(“driveId”位于共享文件的“remoteItem”->“parentReference”下)。然后使用下面的 api 下载其内容。
https://graph.microsoft.com/v1.0/me/drives/{driveId}/items/{id}/content
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)