https://linen.dev logo
notion add data to page is giving blcok error
# 🖥│support-forum
r
please check this log if log_ksiUl0TgIAPk @udaysidagana i am using python sdk composio
Invalid request data provided - Following fields are missing: {'content_blocks.5.content_block', 'content_blocks.1.content_block', 'content_blocks.0.content_block', 'content_blocks.2.content_block', 'content_blocks.3.content_block', 'content_blocks.4.content_block', 'content_blocks.8.content_block', 'content_blocks.7.content_block', 'content_blocks.6.content_block'}
@udaysidagana
{ "parent_block_id": "25725589-cd58-8107-9eae-e8f51fa10b67", "after": null, "content_blocks": [ { "type": "paragraph", "paragraph": { "rich_text": [ { "text": { "content": "Of course, here's a summary of your last two emails:" } } ] } }, ... ] }
request @udaysidagana
@abhishekpatil4
using notion add content to mulitple page
u
Hi @riteshyadav5073, It looks like you've missed entering the complete block objects. Could you retry with a valid block objects?
r
How I can add this codintion in modifiers
I guess llm is not doing this
@Uday
Or what i struction i should add in prompt
Their are 8 blocks i only pasted one as a example
c
The Notion API has a very strict schema, so you can instruct the LLM about how the blocks should be structured. You can refer to the Notion API reference. .
Blocks:
r
Composio docs for notion add multiple pages has content blocks not children
Is that correct?
@Uday
I see the docs composio has content_blocks
u
The argument is a list of content blocks to be added to the page. I'll share an example for your reference:
Copy code
[
    {
      "content_block": {
        "object": "block",
        "type": "heading_2",
        "heading_2": {
          "rich_text": [
            {
              "type": "text",
              "text": {
                "content": "Lacinato kale"
              }
            }
          ]
        }
      }
    },
    {
      "content_block": {
        "object": "block",
        "type": "paragraph",
        "paragraph": {
          "rich_text": [
            {
              "type": "text",
              "text": {
                "content": "Lacinato kale is a variety of kale with a long tradition in Italian cuisine, especially that of Tuscany. It is also known as Tuscan kale, Italian kale, dinosaur kale, kale, flat back kale, palm tree kale, or black Tuscan palm.",
                "link": {
                  "url": "https://en.wikipedia.org/wiki/Lacinato_kale"
                }
              }
            }
          ]
        }
      }
    }
  ]
You can wrap the block object in
content_block
.