How to update an existing block by id #373
-
Hi, I can't find any document about how to update an existing block by using it's id, follow this API https://developers.notion.com/reference/update-a-block Does this library support this feature? |
Beta Was this translation helpful? Give feedback.
Answered by
mariosimao
Jul 19, 2024
Replies: 1 comment
-
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); |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
mariosimao
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello @ezsolu. Sorry for the late reply.
Yes, this library supports updating a block by its ID.
The following example should help you.