How to use client.blocks.update? #183
Answered
by
ramnes
j-chan-hkust
asked this question in
Q&A
-
I have the id for the block I want to update, but it isn't obvious to me how the code is parsing the body/payload I want to update. I've tried a couple orientation, but without a concrete example I'm finding it hard to figure out. |
Beta Was this translation helpful? Give feedback.
Answered by
ramnes
Mar 21, 2023
Replies: 1 comment
-
When in doubt, refer to Notion's documentation and try to do the same with the Python client: https://developers.notion.com/reference/update-a-block Notion gives this JS example: const response = await notion.blocks.update({
"block_id": blockId,
"heading_2": {
"rich_text": [
{
"text": {
"content": "Lacinato kale"
},
"annotations": {
"color": "green"
}
}
]
}
}); So this should work in Python: response = await notion.blocks.update(**{
"block_id": block_id,
"heading_2": {
"rich_text": [
{
"text": {
"content": "Lacinato kale"
},
"annotations": {
"color": "green"
}
}
]
}
}) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
j-chan-hkust
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When in doubt, refer to Notion's documentation and try to do the same with the Python client: https://developers.notion.com/reference/update-a-block
Notion gives this JS example:
So this should work in Python: