| BlocksEndpoint | R Documentation |
Handle all block operations in the Notion API
Note: Access this endpoint through the client instance, e.g., notion$blocks. Not to be instantiated directly.
A list containing the parsed API response.
childrenBlock children endpoint
new()Initialise block endpoint.
Not to be called directly, e.g., use notion$blocks instead.
BlocksEndpoint$new(client)
clientNotion Client instance
retrieve()Retrieve a block
BlocksEndpoint$retrieve(block_id)
block_idCharacter (required). The ID for a Notion block.
update()Update a block
BlocksEndpoint$update(block_id, in_trash = NULL, ...)
block_idCharacter (required). The ID for a Notion block.
in_trashBoolean. Set to TRUE to trash (delete) a block. Set to FALSE to restore a block.
...<dynamic-dots> Block-specific properties to update. Each argument should be named
after a block type (e.g., heading_1, paragraph)
with a named list value containing the block configuration.
delete()Delete a block
BlocksEndpoint$delete(block_id)
block_idCharacter (required). The ID for a Notion block.
notion <- notion_client()
# ----- Retrieve a block
notion$blocks$retrieve("34033ea0-c1e4-8123-be95-e77dcc78e47d")
# ----- Update a block
notion$blocks$update(
"34033ea0-c1e4-8123-be95-e77dcc78e47d",
heading_2 = list(
rich_text = list(list(
text = list(
content = "Updated Test Heading"
)
))
)
)
# ----- Delete a block
notion$blocks$delete(
"34033ea0-c1e4-8123-be95-e77dcc78e47d"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.