如何使用 OneNote api 访问共享内容 [英] How to access shared content using OneNote api

查看:85
本文介绍了如何使用 OneNote api 访问共享内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在我的应用程序中集成 OneNote.使用 OneNote API 我能够获取所有笔记本属于特定用户.

I am integrating OneNote in my application. Using the OneNote API I am able to fetch all the Notebooks that belong to a particular user.

假设用户 A 有 5 个自己的笔记本和 2 个共享的笔记本.

Let's say a user A has 5 Notebooks of his own and 2 shared Notebooks.

假设 NoteBook6 由属于同一 A 组织的用户共享,而 NoteBook7 由外部用户共享.

Let's say NoteBook6 is shared by user which is part of organization same A and NoteBook7 is shared by external user.

在我的应用程序中,我想访问用户可以访问的所有这 7 个笔记本.我使用 Microsoft Graph 和 OneNote API 进行了尝试,但我只能访问用户拥有的 5 个笔记本.

In my application I want to access all these 7 notebooks which user can access. I tried this using Microsoft Graph as well as the OneNote API but I am only able to access the 5 notebooks owned by the user.

有没有办法使用任何 API 访问 Notebook6Notebook7,前提是我不知道谁与我的用户共享了内容?

Is there any way to access Notebook6 and Notebook7 using any API, provided I am unaware of who has shared the content with my user?

Microsoft Graph 提供:

Microsoft Graph provides:

https://graph.microsoft.com/v1.0/users/{id}/onenote/notebooks 

我不想使用这些端点访问共享内容,因为这需要有关与我共享笔记本的用户的详细信息.

I don't want to use these endpoints to access shared content as this requires details about user who has shared notebooks with me.

推荐答案

恐怕不会,这个端点只会返回当前用户拥有的笔记本.

I'm afraid not, this endpoint will only return notebooks owned by the current user.

如果笔记本明确与当前用户共享,它将使用 https://graph.microsoft.com/v1.0/me/drive/sharedWithMe 通过 OneDrive API 显示.这不会返回用户有机访问的笔记本(即他们碰巧有权访问的组或共享点站点的一部分),因此这可能还不够.也就是说,假设您拥有适当的权限范围,您可能能够构建一个有效的 URI 来打开该笔记本(请注意,这只是我的部分推测,我还没有机会尝试这个).

If the notebook was explicitly shared with the current user, it will show up via the OneDrive API using https://graph.microsoft.com/v1.0/me/drive/sharedWithMe. This wouldn't return notebooks that the user organically has access to (i.e. part of a group or sharepoint site they happen to have access to) so this may not be sufficient. That said, assuming you have the proper permission scopes, you may be able to construct a valid URI to open that notebook (please note that this is partially conjecture on my part, I've not had the chance to try this yet).

从概念上讲,使用 onenote/notebooks/sharedWithMe 方法是有意义的.我可以看到几个场景,这将是非常有价值的.我强烈建议将此建议添加到 UserVoice 站点,以便将来进行修订.

Conceptually, having a onenote/notebooks/sharedWithMe method makes sense. I can see several scenarios where this would be quite valuable. I would strongly suggest adding this suggestion to the UserVoice site so it can be considered for future revisions.

这篇关于如何使用 OneNote api 访问共享内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆