KNotion Blocks
Interface for managing Notion blocks through the Notion API. This interface provides methods to create, retrieve, update, and manage blocks within pages and other blocks. Blocks are the fundamental content units in Notion, including paragraphs, lists, to-do items, and more.
Example usage:
// Retrieve blocks from a page
val blocks = client.blocks.getBlockList("page-id")
// Append new blocks to a page
client.blocks.appendBlockList("page-id") {
paragraph("This is a new paragraph")
toDo("Complete this task", checked = false)
}Functions
Appends new blocks as children to a specified parent object (page or block). This method allows you to add multiple blocks at once using a MutableBlockList.
Appends new blocks as children to a specified parent object using a block producer. This overload allows for more dynamic block creation using a BlockListProducer.
Retrieves all blocks within a parent object, including all nested children blocks recursively. This method will fetch the complete block tree structure.
Retrieves a specific block by its ID.
Retrieves the immediate children blocks of a specified parent object (page or block). This method only retrieves the direct children and does not fetch nested blocks.
Updates the content of an existing block.