Forum Discussion

Nick Sevens's avatar
Nick Sevens
Copper Contributor
Jan 02, 2019

Graph created OneNote not recognized as "Site-Notebook"

When creating a new Office365 Group, the "Site Notebook" is not provisioned until the Notebook link is clicked in the left navigation of the associated SharePoint site.

I'm trying to automate this process by creating the Notebook through the GraphAPI (/groups/{id}/onenote/notebooks) - which works fine.

 

However, the newly created notebook is not coupled to the navigation link in the left menu of the SharePoint site.

This results in a second notebook being created when clicking the link.

 

Is there a way to indicate that the notebook I created should be used as the Site Notebook?

 

PS: I also noticed that Notebooks are created in Shared Documents library, and the "default" one in SiteAssets.

    • Matthias Habegger's avatar
      Matthias Habegger
      Copper Contributor

      bratukha 

      The Problem is that the Website-Feature "Site Notebook" is not activated.

      As a Workaround, you could enable the WebSite-Feature Website with CSOM something like this:

      SharePointOnlineCredentials onlineCredentials = new SharePointOnlineCredentials(serviceAccountUsername, serviceAccountPassword);
      ClientContext ctx = new ClientContext(rootSiteWebUrl);
      ctx.Credentials = onlineCredentials;
      ctx.Load(ctx.Web, w => w.Features);
      //Activates Feature SiteNotebook
      ctx.Web.Features.Add(new Guid("f151bb39-7c3b-414f-bb36-6bf18872052f"), true, FeatureDefinitionScope.None);
      await ctx.ExecuteQueryAsync();

       

Resources