【问题标题】:How do I retrieve a site using notions api?如何使用概念 api 检索网站?
【发布时间】:2022-06-14 03:53:33
【问题描述】:

我目前正在尝试使用概念 API 下载站点/页面。 我分享了这个页面并尝试了这个:

(async () => {

    const pageId = 'abcd-editorial-efe.notion.site/Sites-abc123';
  
    const response = await notion.pages.retrieve({ page_id: pageId });
  
    console.log(response);
  
  })();

我收到一条错误消息:

@notionhq/client warn: request fail {
  code: 'object_not_found',
  message: 'Could not find page with ID: abc123..... Make sure the relevant pages and databases are shared with your integration.'
}

这是检索页面的正确 API 端点吗?

Notions docs pageId 是一个 GUID...但是当我分享我的页面时,我得到了一个完整/完整的 URL:

(async () => {

  const pageId = 'b55c9c91-384d-452b-81db-d1ef79372b75';

  const response = await notion.pages.retrieve({ page_id: pageId });

  console.log(response);

})();

我正在使用 "@notionhq/client": "^1.0.4"

【问题讨论】:

  • 您确定您已将集成邀请到页面本身吗?创建集成是不够的。
  • @MuhammadMagdi 我刚刚将页面分享给公众......不知道为什么它不起作用。

标签: javascript node.js notion-api


【解决方案1】:

[Muhammed][1] 把它钉在了 cmets 中

share 部分(右上角)中,选择invite 并邀请您的集成 [1]:https://stackoverflow.com/users/7047338/muhammad-magdi

【讨论】:

    猜你喜欢
    • 2016-09-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-08-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多