如何通过 API 从 Sharepoint 下载此文件?

How to download this file from Sharepoint by API?

提问人:juanjogn93 提问时间:9/12/2023 最后编辑:Brian Tompsett - 汤莱恩juanjogn93 更新时间:10/5/2023 访问量:19

问:

我是以下 URL:https://companyName.sharepoint.com/sites/MySite/Documentos compartidos/Adjuntos/PS00000650/7A80B90F-75A3-4162-BD19-0AD21ECAB4C6.pdf

我需要使用 API 下载文件。

我试过用这个:https://learn.microsoft.com/es-es/sharepoint/dev/sp-add-ins/working-with-folders-and-files-with-rest

但对我不起作用

有什么想法吗?是否可以使用 API 下载文件?

https://learn.microsoft.com/es-es/sharepoint/dev/sp-add-ins/working-with-folders-and-files-with-rest

文件 URL SharePoint 下载

评论

0赞 juanjogn93 9/12/2023
PD:Graph.microsoft 对我不起作用,因为我只有 URL,没有文件夹 ID 或文件 ID

答:

0赞 RaytheonXie-MSFT 10/5/2023 #1

您可以使用以下 api 按路径获取项目

GET /sites/{site-id}/drive/root:/{item-path}