Links (Block base class)
PageBlockCalloutBlockDividerBlockHeading1BlockImageBlockParagraphBlockTableOfContentsBlockToggleHeading2Block
DatabaseBookmarkBlockCodeBlockEmbedBlockHeading2BlockLinkPreviewBlockPdfBlockToDoBlockToggleHeading3Block
1. Class methods
self.new(block_id: nil, sub_block: nil, color: “default”) → SyncedBlock
- [PARAM(optional)] block_id reference synced block’s id
- [PARAM(optional)] sub_blocks
children blocks (Array of Blocks). In
append block children API, there is a limit for nesting children as follows. So, children blocks can not have any children.
For blocks that allow children, we allow up to two levels of nesting in a single request.
- This block can have children blocks when it is an original synced block.
self.new creates a SyncedBlock object using a sub_blocks of block_id are optional parameters.2. Instance methods
append_block_children(*blocks, position: nil, dry_run: false) → Array<Block>, String
- [PARAM] blocks array of blocks
- [PARAM(optional)] position:
where to insert (Notion API
position) nil(default): append at the end"start": insert at the beginning"end": insert at the end (explicit)"<block_id>": insert after the specified block id (after_block)
- [PARAM(optional)] dry_run: true if you want to create a verification script
append_block_children method of an existing block appends some block objects. Some blocks allow child blocks to be set up at the same time. However, due to API limitations, grandchild blocks cannot be created at once. There are many types of blocks, so check the page( Append block children sample) to see how to create blocks.append_block_children(blocks, dry_run: true) creates a shell script using Append block children API for verification. block_id → String
block_id returns the color string for SyncedBlock.