April 21st, 2017

Get Recent Notebooks API

Hello,

One of the most commonly used scenario in OneNote clients is to open your notebook, File => Open => Open Notebook

open-notebooks

Or in some OneNote clients, there is a Home => More Notebooks dialog.

more-notebooks

Or if you login to https://www.onenote.com you will see a list of Recent notebooks like this:

recent-notebooks

For all these above scenarios and many more, we have a new API called GetRecentNotebooks. Here’s how you can call it (with your Microsoft or Work account):

GET https://www.onenote.com/api/v1.0/me/notes/notebooks/getrecentnotebooks(includePersonalNotebooks=true)

This will return the following JSON payload:

json-response

There is a flag to specify whether you want to include your owned personal notebooks in the API response or not. Here’s how you can specify the “includePersonalNotebooks” flag:

GET https://www.onenote.com/api/v1.0/me/notes/notebooks/getrecentnotebooks(includePersonalNotebooks=true) OR

GET https://www.onenote.com/api/v1.0/me/notes/notebooks/getrecentnotebooks(includePersonalNotebooks=false)

You can use this API to keep track of all your recently accessed notebooks. Or to quickly access a notebook that you recently visited.

Since the API always returns your recent notebooks sorted by most recently used, this is a pretty neat way to get your recent most notebook at the top of the list.

Manjusha

Topics
OneNote