>> Hi, Notes Developers. Welcome to Microsoft Build 2018.
I'm Gary Neitzke, Engineering Manager on
the Notes team which owns OneNote integrations in API.
Today, I'll share a brief overview about
OneNote APIs in the Microsoft Graph
and the work we have done over the past year to make
using our APIs easier.
OneNote APIs and Microsoft Graph are quite powerful.
Today, we have over nine million daily calls to
the OneNote API from
Internal Partners and Developers like you.
It gives you the capability to create a Notebook,
traverse the Notebook hierarchy,
capture and retrieve content in-tune from OneNote pages.
OneNote APIs work on
your personal OneDrive as well as your Office 365.
This includes your team sites and
your personal my site as well.
We are also focused on quality of
our API because we know reliability and
performance matter for our Internal Partners
and External Developers like yourself.
We have made many performance fixes to reduce
latencies of the calls you make to the OneNote API.
An example of this is we recently optimized
the most used API, get pages.
We're able to reduce the average latency, 50 percent.
We also fixed some of the most common errors
that Developers encounter,
making the API more reliable
and scalable for your applications.
If you are new to the OneNote APIs
or you've used them in the past few years,
we wrote a blog with some performance,
best practices to make sure
you get the lowest latency requests.
Manjusha is now going to demo
how to use the OneNote APIs.
>> Hi. I'm Manjusha Mangaonkar,
I'm a Software Engineer on the OneNote team.
Here, I have a Chrome extension
called the OneNote Web Clipper which
allows you to clip browser
content onto your OneNote Notebooks.
We are going to use this Clipper and clip
this content to my OneNote Notebook.
And here's the Notebook that I have.
It has an empty section and an empty page in it.
Now, let's try to
clip this content to the Notebook that we just saw.
Also, I'm going to enable filter tracing so we can see
the OneNote APIs that are called by
the Clipper, and hit "Clip."
The Clipper is done.
Let's take a look at
the OneNote API that the Clipper called.
Here's the post-pages request that the Clipper called.
Now, let's take a look at the page that got created.
Great. So we have a new page
created with the content that we just clipped.
Now, let's see how
we can do this using OneNote APIs in Microsoft Graph.
I'm going to use an app called the Graph Explorer which
is available on dev.microsoft.com/graph,
and here, I have
the Graph endpoint URL, graph.microsoft.com/v1.
Underneath the v1, I have the me segment,
and underneath the me segment,
I have the OneNote segment.
This is the endpoint for all of the OneNote APIs.
So underneath OneNote, we have Notebooks,
sections, section groups, pages, et cetera.
In our scenario, we want to do
a post-pages request so
I'm going to switch over to post request,
grab the section ID from the filter trace that we have.
Now, I'm going to grab the content
that we clipped and put it in the request body.
And we also need
the multi-part content type
header, and that's it.
We're going to run this request.
The request is done.
Now, let's take a look at the new page that got
created using the OneNote APIs in Microsoft Graph.
It has the same content as before,
and it looks the same.
Now, this was for my personal Notebook on my site.
All the OneNote APIs that we have
are supported on team site Notebooks as well.
So let's take a look at
how we can do this in a team site.
Here, I have a team site called Microsoft Graph,
and I have a team Notebook in
the team site with an empty section and an empty page.
I'm going to go back to
the Graph Explorer and get the site ID for my team site.
Now, instead of me segment,
we have the site segment.
Underneath the site segment,
we are going to paste
the site's ID for my Microsoft Graph team site.
And after that, the rest
of the segments remain the same like onenote/notebooks,
sections, section groups, pages, et cetera.
In our scenario, we're going to do a post-pages request,
so we'll switch over to post.
I have the section ID of the team Notebook that I'm going
to use here, /pages.
The content type header is already there.
We're going to grab the clipped content
that we used before,
put it in the request body, and run it.
The request is done.
Let's take a look at our team Notebook,
and we have the new page created which looks exactly
the same as before with the same content that we clipped.
Wasn't it easy?
>> Thanks, Manjusha, for those demos of the OneNote APIs.
As you can see, getting started is easy and you can get
some interesting scenarios built up
quickly using the OneNote API.
We're working hard on adding new exciting note-taking
Graph integrations in the future
across the Microsoft 365 ecosystem.
We can't share many of the details right
now but we know you will love it.
It will open up a whole new set of scenarios for you.
You can get started right away with OneNote API.
Visit our Developer Portal,
ask questions on StackOverflow,
check our samples in GitHub,
we have many great examples in different languages,
and we'd love to hear from you on Twitter as well.
Thank you for taking the time to learn about
OneNote API with Manjusha and I today, and happy coding.