I am currently trying to download a site/page using notions API. I shared the page and tried this:
(async () => {
const pageId = 'abcd-editorial-efe.notion.site/Sites-abc123';
const response = await notion.pages.retrieve({ page_id: pageId });
console.log(response);
})();
I get an error saying:
@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.'
}
Is this the correct API endpoint to retrieve a page?
Notions docs pageId is a GUID...but when I shared my page I get a complete/full URL:
(async () => {
const pageId = 'b55c9c91-384d-452b-81db-d1ef79372b75';
const response = await notion.pages.retrieve({ page_id: pageId });
console.log(response);
})();
I am using "@notionhq/client": "^1.0.4"