Class notebooks cannot be fetched via the O365 API

Copper Contributor

Hi,

 

Im trying to fetch a groups class notebooks via the office 365 API so I can copy a newly created OneNote document to it.

 

Even tough the group in question has a class notebook set up the API returns an empty array for "values". Ive tried these two endpoints: https://www.onenote.com/api/v1.0/myOrganization/siteCollections/{id}/sites/{id}/notes/ and https://www.onenote.com/api/v1.0/myOrganization/groups/{id}/notes/

When i used the "siteCollections" i fetched the required data successfully via the

myOrganization/siteCollections/FromUrl(url='{full-path-to-SharePoint-site}')

endpoint and got both required fields. I did have success fetching a class notebook via the GET /notes/noteBooks when I previously created a new class notebook via the API.

 

Any help is appreciated since Im stuck with this issue for some time now.

 

Warm regards,

Andreas Ekström

Haldor AB

2 Replies

Could someone at MS please reply I have a similar issue.

Hi Alice

 

I had to add the following header for all requests:

CustomUserAgent with the value: Teams/1.0

 

Will that solve your issue?

 

Warm regards,

Andreas Ekström