{"id":1272,"date":"2017-04-21T22:11:21","date_gmt":"2017-04-22T05:11:21","guid":{"rendered":"https:\/\/officedevblogs.wpengine.com\/?p=1272"},"modified":"2021-11-15T10:47:07","modified_gmt":"2021-11-15T18:47:07","slug":"get-recent-notebooks-api","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/get-recent-notebooks-api\/","title":{"rendered":"Get Recent Notebooks API"},"content":{"rendered":"<p>Hello,<\/p>\n<p>One of the most commonly used scenario in OneNote clients is to open your notebook, File =&gt; Open =&gt; Open Notebook<\/p>\n<p><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2017\/04\/Open-Notebooks.jpg\"><img decoding=\"async\" class=\"alignnone size-medium wp-image-975\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2017\/04\/Open-Notebooks-280x300.jpg\" alt=\"open-notebooks\" width=\"280\" height=\"300\" \/><\/a><\/p>\n<p>Or in some OneNote clients, there is a Home =&gt; More Notebooks dialog.<\/p>\n<p><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2017\/04\/More-Notebooks.jpg\"><img decoding=\"async\" class=\"alignnone size-medium wp-image-985\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2017\/04\/More-Notebooks-300x252.jpg\" alt=\"more-notebooks\" width=\"300\" height=\"252\" \/><\/a><\/p>\n<p>Or if you\u00a0login to\u00a0<a href=\"https:\/\/www.onenote.com\/\">https:\/\/www.onenote.com<\/a>\u00a0you will see a list of Recent notebooks like this:<\/p>\n<p><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2017\/04\/Recent-Notebooks.jpg\"><img decoding=\"async\" class=\"alignnone size-medium wp-image-995\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2017\/04\/Recent-Notebooks-300x213.jpg\" alt=\"recent-notebooks\" width=\"300\" height=\"213\" \/><\/a><\/p>\n<p>For all these above scenarios and many more, we have a new API called GetRecentNotebooks. Here&#8217;s how you can call it (with your Microsoft or Work account):<\/p>\n<blockquote><p>GET https:\/\/www.onenote.com\/api\/v1.0\/me\/notes\/notebooks\/getrecentnotebooks(includePersonalNotebooks=<strong>true<\/strong>)<\/p><\/blockquote>\n<p>This will return the following JSON payload:<\/p>\n<blockquote><p><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2017\/04\/Json-Response.jpg\"><img decoding=\"async\" class=\"alignnone wp-image-1025 size-full\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2017\/04\/Json-Response.jpg\" alt=\"json-response\" width=\"963\" height=\"540\" \/><\/a><\/p><\/blockquote>\n<p>There is a flag to specify whether you want to include your owned personal notebooks in the API response or not. Here&#8217;s how you can specify the &#8220;includePersonalNotebooks&#8221; flag:<\/p>\n<blockquote><p>GET https:\/\/www.onenote.com\/api\/v1.0\/me\/notes\/notebooks\/getrecentnotebooks(includePersonalNotebooks=<strong>true<\/strong>) OR<\/p>\n<p>GET https:\/\/www.onenote.com\/api\/v1.0\/me\/notes\/notebooks\/getrecentnotebooks(includePersonalNotebooks=<strong>false<\/strong>)<\/p><\/blockquote>\n<p>You can use this API to keep track of all your recently accessed notebooks. Or to quickly access a notebook that you recently visited.<\/p>\n<p>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.<\/p>\n<p>Manjusha<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hello, One of the most commonly used scenario in OneNote clients is to open your notebook, File =&gt; Open =&gt; Open Notebook Or in some OneNote clients, there is a Home =&gt; More Notebooks dialog. Or if you\u00a0login to\u00a0https:\/\/www.onenote.com\u00a0you will see a list of Recent notebooks like this: For all these above scenarios and many [&hellip;]<\/p>\n","protected":false},"author":69223,"featured_media":25159,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[11],"tags":[71],"class_list":["post-1272","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-office-add-ins","tag-onenote"],"acf":[],"blog_post_summary":"<p>Hello, One of the most commonly used scenario in OneNote clients is to open your notebook, File =&gt; Open =&gt; Open Notebook Or in some OneNote clients, there is a Home =&gt; More Notebooks dialog. Or if you\u00a0login to\u00a0https:\/\/www.onenote.com\u00a0you will see a list of Recent notebooks like this: For all these above scenarios and many [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/posts\/1272","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/users\/69223"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/comments?post=1272"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/posts\/1272\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/media\/25159"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/media?parent=1272"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/categories?post=1272"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/tags?post=1272"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}