Chriz
Chriz

Reputation: 1

Not all shared notebooks are returned by API

In our organization there are multiple shared personal notebooks. Because the API still doesn't return shared personal notebooks (as discussed here) we now get the notebooks via this URL https://www.onenote.com/api/beta/myOrganization/siteCollections/[guid1]/sites/[guid2]/notes/.

There are multiple notebooks shared with me, but when I call the API I get some notebooks returned (18 in total), but not all the notebooks in the folder that are shared with me, and some notebooks are returned that aren't in that folder.

I've retrieved the guid1 and guid2 by calling the https://www.onenote.com/api/v1.0/myOrganization/siteCollections/FromUrl(url='https://[org]-my.sharepoint.com/personal/[user]/Documents') API.

Is there another way to get all the available shared notebooks from a users personal OneDrive folder or even better all personal notebooks that are shared with me?

Upvotes: 0

Views: 128

Answers (1)

Manjusha
Manjusha

Reputation: 538

There are 2 options:

  1. Call GET https://www.onenote.com/api/v1.0/me/notes/notebooks/GetRecentNotebooks(includePersonalNotebooks=false). If this gives you all the shared notebooks that you are looking for and you want more metadata (like the notebook id) for each notebook retrieved, then call POST https://www.onenote.com/api/beta/me/notes/notebooks/GetNotebooksFromWebUrls with the recent notebooks web urls in the request body like: {"webUrls":["weburl1","weburl2"]}
  2. Call GET https://wwww.onenote.com/api/v1.0/me/notes/notebooks?includesharednotebooks=true

Upvotes: 1

Related Questions