Most of the battle is getting access tokens for your personal Microsoft account. Try this "streamlined" process:
- Register an application with MS Graph
- Under the Platforms header, create a web app and set the Redirect URL to
- Set the environment variable
CLIENT_IDto the Application ID generated for your app
- Start the Node web app and visit
/loginin your browser
- Login to your MS account, getting redirected to
- Copy the access token out of the URL and assign it to the environment variable
- Restart the Node web app
Be warned that the access token expires after an hour or so.
The web app presents a simplified version of Microsoft's API for getting OneNote data:
/notebooks: Get all notebooks as JSON list.
/sections: Get all notebook sections as JSON list.
/pages: Get all notebook pages (excluding HTML content) as JSON list.
/content: Get all notebook pages (including HTML content) as JSON list.