簡體   English   中英

如何使用圖形 api 到達 Sharepoint 文檔中心

[英]How to reach the Sharepoint document center using the graph api

我正在嘗試使用 Microsoft Graph 從我們的 SharePoint 文檔中心檢索文檔。 我能夠訪問我們的基本 SharePoint 站點,但似乎無法深入到文檔中心。

我們的文檔中心 url 是<sharepoint_host>/sites/DocumentCenter 我希望能夠在<sharepoint_host>/sites/DocumentCenter/Prospects下查看和上傳文件。

嘗試了多種方法以查看是否可以訪問文檔中心,例如:

graphServiceClient
  .Sites["<sharepoint_host>"]
  .SiteWithPath("DocumentCenter")
  .Request().GetAsync()

但似乎無法再次到達它。 使用適用於 .NETMicrosoft Graph SDK

假設/sites/DocumentCenter對應於租戶站點集合和Prospects到列表/庫, Site資源可以通過服務器相對 URL 路徑檢索,如下所示:

GET https://graph.microsoft.com/v1.0/sites/{tenant}.sharepoint.com:/sites/DocumentCenter

請參閱有關如何按路徑尋址站點資源的文檔

要檢索List資源,可以使用以下端點:

GET https://graph.microsoft.com/v1.0/sites/{tenant}.sharepoint.com:/sites/DocumentCenter:/lists/Prospects

例子

var site = await graphClient.Sites["contoso.sharepoint.com"].SiteWithPath("/sites/DocumentCenter").Request().GetAsync();
Console.WriteLine(site.Name);

暫無
暫無

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

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