使用One Note API在特定笔记本的特定部分中获取特定页面的最佳方法? [英] Best way to use One Note API to GET specific pages in specific section in specific notebook?
问题描述
根据 OneNote API文档,我可以获取特定部分中的特定页面,使用:
According to the OneNote API documentation, I can GET specific pages in a specific section using:
../sections/{section-id}/pages[?filter,...]
...,我可以使用以下方法在特定笔记本中获取特定部分:
... and I can GET a specific section in a specific notebook using:
../notebooks/{notebook-id}/sections[filter,...]
...但是,如果我尝试使用以下方法将这些内容组合到特定笔记本的特定部分中的GET特定页面中:
... but if I try to combine these to GET specific pages in a specific section in a specific notebook, using:
../notebooks/{notebook-id}/sections/{section-id}/pages[?filter,...]
...我得到:
"oneNoteGet()中格式错误的请求:笔记本/<笔记本ID>/sections/<部分ID>/页面?..."
"Badly formed request in oneNoteGet() for: notebooks/< notebook-id >/sections/< section-id >/pages?..."
当然,我可以通过以下方法解决此问题:首先获取特定笔记本中所有部分的列表,然后从该列表中选择特定部分,最后请求该部分中的特定页面.
Of course, I can work around this by first getting a list of all the sections in a specific notebook, then from that list selecting a specific section, and finally requesting specific pages in that section.
但是还有更直接的途径吗?还是这只是当前API的不足(在这种情况下,我应该提出UserVoice请求)?
But is there a more direct path? Or is this just a deficiency in the current API (in which case I should put in a UserVoice request)?
推荐答案
在页面实体集上使用OData过滤器:(确保将其展开)
Use an OData filter on the pages entity set: (make sure you expand it)
GET ~/pages?$filter=parentNotebook/id%20eq%20'YOURNOTEBOOKID'&$expand=parentNotebook
这篇关于使用One Note API在特定笔记本的特定部分中获取特定页面的最佳方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!