3

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.

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

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

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.

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 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.

3

2 Answers 2

1

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

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).

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.

4
  • 1
    Added this to UserVoice site. Jun 28, 2017 at 5:44
  • I am using this api to retrieve the list of notebooks shared with me. graph.microsoft.com/v1.0/me/onenote/… The problem here is when I get list of shared notebooks in the field createdBy the dislplayName is reflecting the valid name of user who has shared this with me. But in that the id of user reflected is incorrect. It's just displaying my id in that. This seems to be like bug in onenote api Sep 26, 2017 at 12:09
  • I would double check that. I can't replicate this behavior. I attempted to reproduce by creating 2 users, each with 2 notebooks. Each had 1 notebook shared with the other. Hitting /me/onenote/notebooks only returns 2 notebooks for each of the users. You're suggesting you would see 3? Sep 26, 2017 at 14:41
  • Yes I would see three notebooks of if I am adding includesharednotebooks=true as request parameter. But after that I can't access the sections/pages in that shared notebooks Sep 26, 2017 at 17:01
0

Try calling the following API:

https://www.onenote.com/api/v1.0/me/notes/notebooks/getrecentnotebooks(includePersonalNotebooks=true)

https://blogs.msdn.microsoft.com/onenotedev/2017/04/21/get-recent-notebooks-api/

2
  • This is just giving me notebooks name. How can I access the section or pages inside these notebooks Jun 28, 2017 at 6:45
  • 1
    I am using this api to retrieve the list of notebooks shared with me. graph.microsoft.com/v1.0/me/onenote/… The problem here is when I get list of shared notebooks in the field createdBy the dislplayName is reflecting the valid name of user who has shared this with me. But in that the id of user reflected is incorrect. It's just displaying my id in that. This seems to be like bug in onenote api Sep 26, 2017 at 8:59

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.