0
votes

I am currently using the Microsoft Graph Explorer to query the OneNote API to try and get Notebooks stored on a SharePoint site.

However, the Notebooks were created in teams but I can access them from a browser with our SharePoint url - not sure if this complicates anything?

The issue I am having is I am trying to get a set of Notebooks in a specific location (folder) and I am using the URL:

https://graph.microsoft.com/v1.0/sites/{organisationID}/onenote/notebooks - this does return a successful response but it has no meaningful data, only links which also return nothing meaningful.

Any help or feedback would be greatly appreciated.

Cheers

1

1 Answers

1
votes

It appears you are after List pages endpoint which returns a list of pages in a OneNote, the following example demonstrates how to return Page title and contentUrl properties:

GET https://graph.microsoft.com/v1.0/sites/{site-id}/onenote/pages?$select=title,contentUrl 

where contentUrl returns the URL for the page's HTML content

Since by design notebook contains one or more notebook sections and each section in turn contains one or more pages, the following query demonstrates how to retrieve pages along with associated section and notebook:

GET https://graph.microsoft.com/v1.0/sites/{site-id}/onenote/pages?$expand=parentSection,parentNotebook