OneNoteAPISampleWinUniversal
Code sample with examples of how to use the OneNote API on a Windows 8.1 and above Universal app
Install / Use
/learn @OneNoteDev/OneNoteAPISampleWinUniversalREADME
OneNote service API Windows Universal Sample README
Created by Microsoft Corporation, 2015. Provided As-is without warranty. Trademarks mentioned here are the property of their owners.
Intro
- Universal Windows apps
- This is a newer and better version of the previously released oneNote API WinStore and WinPhone code samples. Use this code sample to build universal Windows 8.1 and above apps.
- As of August 2015, this code sample contains examples of all shipped features as well as most of the beta features released by the OneNote API team.
If you wish to ignore the app UI/design and directly get to the part that interacts with the OneNote API, you can find the code under the OneNoteServiceSamplesWinUniversal.Shared/OneNoteApi folder.
OneDrive based API
You can find additional documentation at the links below.
- Authenticate the user using the OnlineIdAuthenticator API
- In our previous WinStore and WinPhone Code samples we demonstrated how to use the LiveSDK to do OAuth against the Microsoft Account service. This code sample, demonstrates an alternative way to do OAuth using the new Windows.Security.Authentication.OnlineId.OnlineIdAuthenticator class. Both the existing Live SDK approach and this alternative will work in Windows 8.1 universal apps
- The usage of the OnlineIdAuthenticator class is based on the Windows universal code sample
- Create Pages:
- POST simple HTML to a new OneNote Quick Notes page
- POST multi-part message with image data included in the request
- POST page with a snapshot of an embedded web page HTML
- POST page with a URL rendered as an image
- POST page with a file attachment
- POST page with a PDF file rendered and attached
- POST page with note tags
- POST page with a business card automatically extracted from an image
- POST page with a recipe automatically extracted from a URL
- POST page with a product info automatically extracted from a URL
- Extract the returned oneNoteClientURL and oneNoteWebURL links
- POST page in a specific named section
- POST page under a specific notebook and section
- Query and Search Pages:
- GET a paginated list of all pages in OneNote
- GET metadata for a specific page
- GET pages with title containing a specific substring using the $filter query parameter and contains method
- GET pages using OData v4 query parameters like $skip and $top
- GET a sorted list of pages using the $orderby query parameter
- GET selected metadata for pages using the $select query parameter
- GET pages containing the matching search term using the search query parameter
- GET back a specific page's content as HTML
- Manage Notebooks and Sections:
- GET all notebooks and sections in one round trip using the $expand query parameter
- GET a list of all notebooks
- GET metadata for a specific notebook
- GET a list of all sections
- GET metadata for a specific section
- GET a list of all section groups
- GET notebooks and sections with a specific name using the $filter query parameter
- GET notebooks shared by others using the $filter query parameter and userRole property
- GET a sorted list of notebooks using the $orderby query parameter
- GET selected metadata for notebooks using the $select query parameter
- GET a list of all sections under a specific notebook
- POST a new notebook
- POST a new section group under a specific notebook
- POST a new section group under a specific section group
- POST a new section under a specific notebook
- POST a new section under a specific section group
- Update Pages:
- Examples of PATCH Pages
- Delete Pages:
O365 based API (only available on beta)
All the APIs for Microsoft Account (LiveId) are supported in O365 as well except the following:
- $search query option is currently not supported.
Prerequisites
Tools and Libraries you will need to download, install, and configure for your development environment.
- Operating system requirements for developing Windows universal apps:
- Client: Windows 8.1 OR
- Server: Windows Server 2012 R2
- Phone: Windows Phone 8.1 (developer unlocked phone for device testing. Alternatively emulators can be used)
- Visual Studio 2013 Update 4 or later.
Be sure you enable the Windows Phone SDK when you install Visual Studio. If you don't, you will need to un-install and re-install Visual Studio to get those features.
For using emulator (Windows Phone), make sure to enable hyper-v
- You can get a full list of tools needed to build Universal Windows app here
** O365 specific Pre-requisites
-
What you need to do is to go to Programs and Features, Turn on/off Windows features and then choose to add Windows Identity Foundation 3.5 to your system.
-
NuGet packages used in the sample. These are handled using the package manager, as described in the setup instructions. These should update automatically at build time; if not, make sure your NuGet package manager is up-to-date. You can learn more about the packages we used at the links below.
- Newtonsoft Json.NET package provides Json parsing utilities.
- Active Directory Authentication Library package provides AAD authentication utilities (for Office 365)
Accounts
To use this Code Sample in your own Microsoft Account based app, be sure to do the following:
- As the developer, you'll need to have a Microsoft account and get a client ID string so your app can authenticate. Get a client ID string and copy it into the file under [.../OneNoteServiceSamplesWinUnivers
Related Skills
node-connect
351.8kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
110.9kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
351.8kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
351.8kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
