Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Problem] New notion API links response format breaks links parsing and links to database pages. #94

Open
kmlbgn opened this issue Dec 18, 2023 · 0 comments

Comments

@kmlbgn
Copy link

kmlbgn commented Dec 18, 2023

Unless I did something wrong with my setup, It seems notion has changed the href which now only uses the page id instead of the old https://www.notion.so/SomePageTitle-PageID format. This is now the format for raw links (using @)

 {
    "type": "mention",
    "mention": {
        "type": "page",
        "page": {
            "id": "9aa7ca32-eadd-4151-bec4-88c534773fca"
        }
    },
    "annotations": {
        "bold": false,
        "italic": false,
        "strikethrough": false,
        "underline": false,
        "code": false,
        "color": "default"
    },
    "plain_text": "Untitled",
    "href": "https://www.notion.so/9aa7ca32eadd4151bec488c534773fca"
},

"RAW" internal links no longer matches InternalLink regex and are not being processed by convertInternalUrl

Checking to see if a plugin wants to modify "[D1 P1](https://www.notion.so/9aa7ca32eadd4151bec488c534773fca)" 
plugin "standard internal link conversion" did not match this url
plugin "standard external link conversion" did not change this url

Related to: #39 and #40

It seems also that the type link_to_page has been replaced by mention

https://developers.notion.com/reference/block#mention

and the parameter is no longer located at the root but is nested as child of paragraph.
This breaks the use of the database for pages.

{
    "object": "block",
    "id": "ac5a6780-4379-4fec-873d-f6aa5f91e64c",
    "parent": {
        "type": "page_id",
        "page_id": "9fad7f0e-9e49-4e7a-97b6-6008911cceeb"
    },
    "created_time": "2023-12-18T14:16:00.000Z",
    "last_edited_time": "2023-12-18T14:18:00.000Z",
    "created_by": {
        "object": "user",
        "id": "1d84dd47-93aa-4d90-94bf-e85c17ca9367"
    },
    "last_edited_by": {
        "object": "user",
        "id": "1d84dd47-93aa-4d90-94bf-e85c17ca9367"
    },
    "has_children": false,
    "archived": false,
    "type": "paragraph",
    "paragraph": {
        "rich_text": [
            {
                "type": "mention",
                "mention": {
                    "type": "page",
                    "page": {
                        "id": "9aa7ca32-eadd-4151-bec4-88c534773fca"
                    }
                },
                "annotations": {
                    "bold": false,
                    "italic": false,
                    "strikethrough": false,
                    "underline": false,
                    "code": false,
                    "color": "default"
                },
                "plain_text": "D1 P1",
                "href": "https://www.notion.so/9aa7ca32eadd4151bec488c534773fca"
            },
            {
                "type": "text",
                "text": {
                    "content": " ",
                    "link": null
                },
                "annotations": {
                    "bold": false,
                    "italic": false,
                    "strikethrough": false,
                    "underline": false,
                    "code": false,
                    "color": "default"
                },
                "plain_text": " ",
                "href": null
            }
        ],
        "color": "default"
    },
    "developer_survey": "https://notionup.typeform.com/to/bllBsoI4?utm_source=postman",
    "request_id": "c3c44aab-1f80-42d0-a21a-4b701c78c0b9"
}
@kmlbgn kmlbgn changed the title [Problem] Links are no longer being processed (new href response format) [Problem] New notion API links response format breaks links parsing and links to database pages. Dec 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant