【问题标题】:Get OneNote pages through its web API通过其 Web API 获取 OneNote 页面
【发布时间】:2014-10-20 02:49:00
【问题描述】:

我正在尝试开发一个与 OneNote API 交互的 NodeJS。目前我正在尝试检索 onenote 页面的内容(HTML)。

根据使用 beta API 可能的文档 (http://dev.onenote.com/docs),应该是 www.onenote.com/api/beta/sections/{id}/pages,但我尝试了很多次都没有成功.我总是收到错误响应:

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 可以正常工作,因为 API 参考 here 中的 Web 客户端运行良好。

如果有人能对此有所了解,我将不胜感激。

提前致谢。

附:我可以在同一个 API 中完美访问非 beta 端点。

【问题讨论】:

    标签: node.js api onenote


    【解决方案1】:

    您收到此错误是因为您没有请求(并随后让用户授予)用户笔记本的读取权限,而不是因为它是 beta API - /v1.0/beta 的权限相同.

    This article on MSDN 解释了 OneNote API 的所有范围。

    那篇文章的摘要是:

    • 如果您只需要为您的应用程序创建和调用页面,您将需要office.onenote_update_by_app
    • office.onenote_update 将让您全权委托 CRUD 访问用户的所有 OneNote 内容
    • office.onenoteoffice.onenote_create 将允许您访问用户的页面并创建新页面,但不能对用户的任何笔记本、分区或页面进行编辑。

    【讨论】:

    • 非常感谢,完美运行!!显然,这是我使用 API 的第一步。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-04-10
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多