簡體   English   中英

如何使用MS圖訪問sharepoint在線站點中的文檔庫

[英]How to access a document library in a sharepoint online site using MS graph

我可以使用以下請求訪問我的一個驅動器上的文檔:

https://graph.microsoft.com/v1.0/me/drive/root/children

我能夠通過以下請求訪問公司的根共享點站點的文檔庫:

https://graph.microsoft.com/v1.0/drive/root/children

它給了我“根”庫的內容:

https://<my company>.sharepoint.com/Shared%20Documents

我無法訪問我創建的SP子網站的文檔庫。 例如這一個:

https://<my company>.sharepoint.com/samplesp/Shared%20Documents

如何使用MS Graph訪問這樣的文檔庫?

要訪問SharePoint網站和列表,請查看Microsoft Graph中的SharePoint API文檔。

更新:

對於那些使用MS Graph API訪問特定SharePoint站點上的默認驅動器(以前稱為“文檔”庫)有問題的用戶:

您應該查看有關在OneDrive上訪問文件的文檔。

如問題中所述,此端點為我們提供了私有OneDrive上的文件列表:

.../me/drive/root/children

開車在SharePoint網站上的作品以同樣的方式,但不是me ,你應該為你要訪問的網站的全球ID( 全球編號<hostName>,<siteCollectionId>,<siteId>

總之:此端點為我們提供了指定站點的默認驅動器上的文件列表:

.../Sharepoint/sites/<hostName>,<siteCollectionId>,<siteId>/drive/root/children

如果要訪問特定列表中的文件,您只需要列表的ID:

.../Sharepoint/sites/<hostName>,<siteCollectionId>,<siteId>/lists/<listId>/drive/root/children

現在應該是顯而易見的。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM