After many information about the release of OneNote Service API was spread around it’s time to get our hands dirty. Compared to the first release there is some real progress. For making this visible without reinventing the wheel, there is a very nice project available for Visual Studio. Now, let’s have a look!
Primary target of this blog is showing you the latest capabilities of the OneNote Service API on a practical and extendable, but easy example for developers. The API started a few weeks ago with some limitations. Since May 2014 we are able to define a specific section within our notebook to send our data to. Furthermore, rendering of PHP and PDF content is now supported. These are some important steps into the right direction for making the API really powerful.
Now, let’s start and get our hands dirty! For getting the demo project, go to GitHub and download the project by clicking on “Download ZIP”.
Don’t forget to prepare your Visual Studio platform with the Windows Phone SDK, if it’s not happened, yet. Visual Studio has to be ready for creation and deployment of apps for Windows Phone 8.
Another thing to prepare is getting a client ID for your application. This client ID will be pasted into the project’s code, later on. For creating a client ID go to the Microsoft account Developer Center. After creation of the client ID, please keep it private!
The project will need NuGet for downloading some probably missing packages. Go to the Visual Studio Options to allow NuGet to download those missing packages.
After having opened the demo project, open Mainpage.xaml and insert the client ID you have created. That’s basically it for getting the app up and running.
When you are starting the “Emulator WVGA 512MB” for the first time, please check whether the dedicated VM is created within your local Hyper-V host, correctly.
When your emulated Windows Phone is running, please check your Internet connection. Then run the dedicated app on Windows Phone. It’s default name is “WinPhoneOneNoteServiceSample”. Then sign in to OneNote.com by authenticating with your Microsoft account. Last but not least you have to accept the necessary app permissions for making it able to do it’s job.
After having logged in successfully you can type in the name of a specific section, where you want to create your page(s) with some demo content. If you don’t enter a section name, the pages will be created unterneath the “Quick Notes” section. If the the section does not exist yet, it will be created, automatically.
For having a look at the result, wait for the desktop application to synchronize or go directly to your web based notebook on OneNote.com. The example given here shows the new PDF rendering capability of the OneNote Service API.
The demo project given here is a very good introduction when you want to start developing your own apps using the OneNote Service API. Now you can do some research on the code to really understand what’s happening under the hood. Sure, there are still some gaps in functionality (create a new notebook), but Microsoft is pushing it forward step by step.
OneNote Dev Blog
Other example projects using OneNote Service API
Written by: Karsten Ulferts