【问题标题】:accessing files and folders other than sharepoint site's default shared documents using office365 api使用office365 api访问共享点站点默认共享文档以外的文件和文件夹
【发布时间】:2015-01-07 22:23:36
【问题描述】:

在 Windows 商店应用程序上工作: 我正在尝试访问 office365 文档库的文件和文件夹。 我可以访问此链接Common file tasks using the Office 365 client library

中描述的单驱动器文档

但它不提供访问 onedrive 文档库以外的文件和文件夹的方法。 例如 [https://my-office365-tenant.sharepoint.com/mysite/mydocumentslibrary]

但是我尝试了一种方法,它确实获取了 onedrive 以外的文件和文件夹。 我没有使用我创建的 SharePointClient 的任何功能,如下所示:

var client = new SharePointClient(new Uri("https://my-office365-tenant.sharepoint.com/mysite"),
        async () => await AcquireTokenAsync(AuthenticationContext, "https://my-office365-tenant.sharepoint.com"));
    IPagedCollection<IItem> items = await client.Files.ExecuteAsync();

通过这种方式,我在“mysite”中获取默认“共享文档”文档库的文件,但我想在同一站点“mysite”中获取另一个文档库“mydocumentslibrary”的文件和文件夹。

谁能指导我如何做到这一点,或者我错过了什么?或者还有其他方法可以仅使用 office365 api 来做到这一点。

【问题讨论】:

    标签: sharepoint windows-store-apps office365


    【解决方案1】:

    我刚刚浏览了这个新API的文档,文件操作似乎仅限于一个驱动器,我怀疑你可以在另一个文档库中获取文件。

    要获取其他文档库中的文件,在开发 windows store 应用程序时,您可以使用 SharePoint 移动对象模型或 REST API:

    1. Overview of the SharePoint 2013 mobile object model
    2. Get started withthe SharePoint 2013 REST service

    【讨论】:

    • 谢谢。我知道我可以使用,但我们必须使用 office365 api。你告诉的选项是我们最后的选择。
    【解决方案2】:

    API 仅允许访问默认文档库。示例:

    OneDrive for Business:https://{tenant}-my.sharepoint.com/_api/v1.0/me

    SharePoint 站点:https://{tenant}.sharepoint.com/{site-path}/_api/v1.0

    【讨论】:

      猜你喜欢
      • 2021-10-27
      • 2020-05-03
      • 1970-01-01
      • 2019-12-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多