【发布时间】: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