获取通过其Web API的OneNote页面 [英] Get OneNote pages through its web API
问题描述
我试图开发一种认为的NodeJS与OneNote的API进行交互。目前我;:M试图检索OneNote的网页的内容(HTML中)
I'm trying to develop a NodeJS that interact with the OneNote API. Currently I;m trying to retrieve the content (the HTML) of the onenote pages.
他使用API测试版,这应该是www.onenote.com/api/beta/sections/{id}/pages,但我试过很多次都没有成功。我总是得到一个错误响应:
Based on the documentation (http://dev.onenote.com/docs) that is possible using he beta API, which should be www.onenote.com/api/beta/sections/{id}/pages, but I've tried many times without success. I always get an error response:
403
{
"error":{
"code":"40004","message":"The OAuth token provided does not have the necessary scopes to complete the request. Please make sure you are including one of the following scopes: Office.onenote_update,Office.onenote_update_by_app,Office.onenote","@api.url":"http://go.microsoft.com/fwlink/?LinkID=400836"
}
}
我知道API的工作,因为Web客户端是在API参考 present这里效果很好。
如果有人能在这一些启发,我会AP preciated。
If someone could shed some light on this, I would appreciated.
感谢在前进。
P.S。我可以完全访问非测试终点相同的API中。
P.S. I can perfectly access non-beta endpoint in the same API.
推荐答案
您会收到此错误,因为你没有要求(随后有用户许可)读取用户的笔记本的权限,而不是因为它是一个测试版API - 对 /v1.0
的权限和 /β
是相同的。
You're receiving this error because you haven't requested (and subsequently had the user grant) read permissions for the user's notebook, not because it is a beta API – the permissions for /v1.0
and /beta
are identical.
This article on MSDN explains all of the scopes for the OneNote API.
这是文章的摘要:
- 您会希望
office.onenote_update_by_app </ code>如果你只需要创建和调用您的应用程序页面。
-
office.onenote_update
会给你所有用户的OneNote内容全权CRUD访问 -
office.onenote
和office.onenote_create
将让你访问用户的页面并创建新的页面,但不进行编辑的任何用户的笔记本,节或页面。
- You'll want the
office.onenote_update_by_app
if you only need to create and recall pages for your application. office.onenote_update
will give you carte blanche CRUD access to all of a user's OneNote contentoffice.onenote
andoffice.onenote_create
will let you access a user's pages and create new pages, but not make edits to any of the user's notebooks, sections, or pages.
这篇关于获取通过其Web API的OneNote页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!