Closed hatton closed 2 years ago
Hey there, Thanks for reporting the issue.
Had a look at the notionhq API response for all the above you have mentioned cases:
and here is the response:
here you can see the raw link to the page is not yet supported by notion API so that is something I can't help you out with.
It would be great if you can verify the same from yourside.
I appreciate you looking into this. I don't know exactly what kind of object it told you was unsupported. For me, @notionhq/client gives the result I showed in the original report.
The API has supported linked pages since November 2021. See Synced Block, Link to Page and Template block types are now supported in the API. @notionhq/client has supported it since 0.4.8. https://github.com/makenotion/notion-sdk-js/releases/tag/v0.4.8.
May I know the version of @notionhq/client you are using?
This side it's v1.0.4 (latest).
I tired it on different notion pages and databases as well but it still shows type: unsupported
.
Mind sharing the code snippet you are using to get the response object?
Sure, here are full steps:
1) Duplicate this page: https://hattonjohn.notion.site/link_page-sample-a73ae52733ae4e98bc46923f0e7459b6
2) Share your own integration with your page
3) Code like this:
"@notionhq/client": "^1.0.4",
import { Client } from "@notionhq/client";
import { env } from "process";
const notionClient = new Client({
auth: env.YOUR_INTEGRATION_TOKEN,
});
notionClient.blocks.children
.list({
block_id: "<YOUR PAGE ID>",
})
.then(b => console.log(JSON.stringify(b, null, 2)))
.catch(e => console.error(e));
$ ts-node src/link_page.ts
{
...
{
"object": "block",
"id": "426ae49a-7373-47a8-992c-c5df7a9bf588",
"created_time": "2022-05-27T14:00:00.000Z",
"last_edited_time": "2022-05-27T14:00:00.000Z",
"created_by": {
"object": "user",
"id": "11fb7f16-0560-4aee-ab88-ed75a850cfc4"
},
"last_edited_by": {
"object": "user",
"id": "11fb7f16-0560-4aee-ab88-ed75a850cfc4"
},
"has_children": false,
"archived": false,
"type": "link_to_page",
"link_to_page": { <-------------------
"type": "page_id",
"page_id": "5d4f91d1-80cd-4a36-a284-905905c92001"
}
}
}
``
Submitted PR #32
hey there @hatton Thanks for the snippet, I used the same snippet and got following results:
so not sure what's the issue over here and the same goes for the changes in PR #32 Is the PR working for you?
Is the PR working for you?
Yes, of course. It seems like at this point maybe you could file a bug report with Notion to try and figure out what is going on with your account. For me, everything is working according to the Notion API documentation.
Yes, I did that already and waiting for their response on slack. Once it is resolved I'll merge and create a release.
@hatton Seems like no one is responding but if the PR works for you I'll merge it and create a new release.
A raw link to another website, e.g.
This is a bare to google https://www.google.com/
is emitted asThis is a bare to google [https://www.google.com/](https://www.google.com/)
A bit of text with an underlying link to another page
is emitted as
This is an inline link another page [Apples](/c62dbc3fede94264a1d5e0245fa4be73).
However, if you have a link without a text label, then notion-to-md just drops it. This is emitted as
This is a raw link to the intro:
In the content returned by the API, this last case comes as this kind of block