Created by Microsoft Corporation, 2014. Provided As-is without warranty. Trademarks mentioned here are the property of their owners.
###The below code sample should be considered for legacy reasons only. For the most up to date Windows code samples, see the newer and more detailed Windows Universal code sample
The following aspects of the API are covered in this sample. You can find additional documentation at the links below.
- Log-in the user using the Live SDK
- POST simple HTML to a new OneNote QuickNotes page
- POST page in a specific section
- POST multi-part message with image data included in the request
- POST page with a URL rendered as an image
- POST page with a file attachment
- POST page with a PDF file rendered and attached
- Extract the returned oneNoteClientURL and oneNoteWebURL links
Tools and Libraries you will need to download, install, and configure for your development environment.
Be sure you enable the Windows Phone SDK when you install Visual Studio. If you don't, you will need to uninstall and re-install Visual Studio to get those features.
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.
- Windows Live Connect SDK provides the sign-in and authorization libraries
- .NET Http.client library provides libraries that handle the HTTP request/responses.
- Microsoft BCL Build components provide build-infrastructure components.
- Microsoft BCL Portability Pack provides support for down-level data types.
Accounts
- As the developer, you'll need to have a Microsoft account and get a client ID string so your app can authenticate with the Microsoft Live connect SDK.
After you've setup your development tools, and installed the prerequisites listed above,...
-
Download the repo as a ZIP file to your local computer, and extract the files. Or, clone the repository into a local copy of Git.
-
Open the project in Visual Studio.
-
Get a client ID string and copy it into the file .../MainPage.xaml.cs (~line 63).
-
Build and run the app (F5).
(If your copy of NuGet is up-to-date, it should automatically update the packages. If you get package-not-found errors, update NuGet and rebuild, and that should fix it.)
-
Sign in to your Microsoft account in the running app.
-
Allow the app to create new pages in OneNote.
This is the initial public release for this code sample.
- Visit the dev.onenote.com Dev Center
- Contact us on StackOverflow (tagged OneNote)
- Follow us on Twitter @onenotedev
- Read our OneNote Developer blog
- Explore the API using the apigee.com interactive console. Also, see the short overview/tutorial.
- API Reference documentation
- Debugging / Troubleshooting
- Getting Started with the OneNote service API