如何获取Notion API中的block Id?

How to get the block Id in Notion API?

当我尝试附加子块时,块 ID 是必需的。
我试图在文档中查找但没有找到。
我怎样才能得到那个块 ID?

official documentation 中有一个例子,他们说

The block_id parameter is the ID of any existing block. If you're following from the example above, the response contained a page ID. Let's use that page ID to read the sample content from the page. We'll use "16d8004e-5f6a-42a6-9811-51c22ddada12" as the block ID.

因此,我会使用 PageID 作为 Append Block Children 方法的 BlockID。

official documentation 说:

A block object represents content within Notion. Blocks can be text, lists, media, and more. A page is a type of block, too!

Some blocks have more content nested inside them. Some examples are indented paragraphs, lists, and toggles. The nested content is called children, and children are blocks, too! Block types which support children are "paragraph", "bulleted_list_item", "numbered_list_item", "toggle", "to_do" and "page".

要获取页面的id,只需在概念中打开页面并检查URL。页面的 URLs 通常具有以下格式:

https://www.notion.so/Creating-Page-Sample-ee18b8779ae54f358b09221d6665ee15

ee18b8779ae54f358b09221d6665ee15 是页面的 ID,您可以将其用作块 ID。

要获取其他类型块的 ID(段落),“bulleted_list_item”,“numbered_list_item”,“切换”,“to_do”),只需单击块的菜单图标,然后单击“复制 link”。

之后,将 link 粘贴到浏览器中,它应该如下所示:

https://www.notion.so/Creating-Page-Sample-ee18b8779ae54f358b09221d6665ee15#7fcb3940a1264aadb2ad4ee9ffe11b0e

7fcb3940a1264aadb2ad4ee9ffe11b0e 是您可以在请求中使用的块 ID。