Skip to content

How to update an existing block by id #373

Answered by mariosimao
ezsolu asked this question in Q&A
Discussion options

You must be logged in to vote

Hello @ezsolu. Sorry for the late reply.

Yes, this library supports updating a block by its ID.

The following example should help you.

<?php

use Notion\Notion;

$token = $_ENV["NOTION_SECRET"];
$notion = Notion::create($token);

$blockId = "c986d7b0-7051-4f18-b165-cc0b9503ffc2";
$block = $notion->blocks()->find($blockId);

// Update your block here...

$updatedBlock = $notion->blocks()->update($block);

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by mariosimao
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants