Inserting image to Notion column

Hi,

I need to insert an image to notion column block. I am using the Make an API call module.

  • Creating 3 columns with text content works well (see request 1).
  • Inserting an image works (see request 2).

But I can’t find a way to insert the image to one of the columns.

I also tried to do it in multiple steps - first creating the column list, columns and a paragraph in each of them. Then using the GET children request to obtain the IDs of columns and then using the PATCH children again with the Request 2 body content. Did not work. Well - I have the image in my notion page, but not in the column. (The block ID in URL matches the column ID, I checked 3 times.)

Any time I try to merge the requests to just one and insert the image when creating a column, I get [400] Error parsing JSON body, event though JSON is ok. I suppose this is simply because the parser on the other side does not know my JSON structure.

As to official documentation, I read it, but I miss examples for my use case.

Any ideas how to do this?

scenario.blueprint (1).json (115.7 KB)

Request 1:

{
“children”: [
{
“object”: “block”,
“type”: “column_list”,
“column_list”: {
“children”: [
{
“object”: “block”,
“type”: “column”,
“column”: {
“children”: [
{
“object”: “block”,
“type”: “paragraph”,
“paragraph”: {
“rich_text”: [
{
“type”: “text”,
“text”: {
“content”: “Text v prvním sloupci”
}
}
]
}
}
]
}
},
{
“object”: “block”,
“type”: “column”,
“column”: {
“children”: [
{
“object”: “block”,
“type”: “paragraph”,
“paragraph”: {
“rich_text”: [
{
“type”: “text”,
“text”: {
“content”: “Text ve druhém sloupci”
}
}
]
}
}
]
}
},
{
“object”: “block”,
“type”: “column”,
“column”: {
“children”: [
{
“object”: “block”,
“type”: “paragraph”,
“paragraph”: {
“rich_text”: [
{
“type”: “text”,
“text”: {
“content”: “Text ve třetím sloupci”
}
}
]
}
}
]
}
}
]
}
}
]
}

Request 2:
{
“children”: [
{
“type”: “image”,
“image”: {
“external”: {
“url”: “https://www.notion.so/images/logo-ios.png”
},
“type”: “external”
},
“object”: “block”
}
]
}

Hi Cenka,

Thanks for sharing the blueprint. I tried this JSON body on a single request, and it worked. Does this help you with resolving your use case?

{ “children”: [ { “object”: “block”, “type”: “column_list”, “column_list”: { “children”: [ { “object”: “block”, “type”: “column”, “column”: { “children”: [ { “object”: “block”, “type”: “paragraph”, “paragraph”: { “rich_text”: [ { “type”: “text”, “text”: { “content”: “Text in first column” } } ] } } ] } }, { “object”: “block”, “type”: “column”, “column”: { “children”: [ { “object”: “block”, “type”: “image”, “image”: { “type”: “external”, “external”: { “url”: “https://www.notion.so/images/logo-ios.png” } } }, { “object”: “block”, “type”: “paragraph”, “paragraph”: { “rich_text”: [ { “type”: “text”, “text”: { “content”: “Text in second column” } } ] } } ] } }, { “object”: “block”, “type”: “column”, “column”: { “children”: [ { “object”: “block”, “type”: “paragraph”, “paragraph”: { “rich_text”: [ { “type”: “text”, “text”: { “content”: “Text in third column” } } ] } } ] } } ] } } ] }

1 Like

Hi,
I don’t know what has changed, but I tried it again and it worked. I might have changed something without noticing and did not realize it started working.

Thanks a lot - if you didn’t try, I probably wouldn’t find out it works.

Anyway, my whole project colapsed on views, because notion doesn’t have an endpoint for managing them. :sweat_smile:

1 Like