The OneNote Class Notebook APIs let you programmatically create and edit class notebooks. This sample demonstrates the basics on how you would call these APIs using JavaScript, jQuery and ADAL for authentication. To learn more about ADAL you can visit its GitHub page. For full documentation on the class notebook APIs take a look at our article on MSDN.
Please keep in mind that this sample is meant to illustrate how you would reach our APIs in JavaScript and does not necessarily contain all the code you would want for a production-ready application. In a more complete web app you would probably use a framework like AngularJS, add more specific error handling, etc.
If you would like to see a live version of this app we have an instance running on Azure that you can access here.
- An Azure subscription
- An Office 365 subscription
The Azure subscription should be associated with the Office 365 subscription. Authenticate using Azure AD (enterprise apps) has details on how to do just that.
Again, follow the instructions under Authenticate using Azure AD (enterprise apps) to register your application in Azure. You will also need to give your app Notes.ReadWrite permissions.
Since this web app uses OAuth 2's implicit grant flow, you should enable it in your app's manifest in Azure. This article has details on the implicit grant flow and how to enable in Azure. In particular, you'll want to download your app's manifest in the Azure Management Portal, set the "oauth2AllowImplicitFlow" field to true, and upload the manifest to the portal.
You will need to specify the clientId for your app in app.js. You can get the clientId in the Azure Management Portal.
If you are using Visual Studio, build and run your application. To test your application locally you will also need to add the local URL as a reply URL in your app's page in the Azure Management Portal. The sample is set to run at localhost:55407.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.