ブロックの子を追加
PATCH
/v1/blocks/{block_id}/children新しい子ブロックを作成し、指定された親block_id
に追加します。
新しく作成された第 1 レベルの子ブロック オブジェクトのページ分割されたリストを返します。
📘ブロックは移動できません
ブロックは、親ブロックの下部に追加されます。ブロックが子として追加されると、API を介して別の場所に移動することはできません。
📘ネストされた子
子を許可するブロックの場合、1 回のリクエストで最大 2 レベルのネストが許可されます。
📘統合機能
このエンドポイントには、コンテンツ挿入機能を持つ統合が必要です。コンテンツ挿入機能なしでこの API を呼び出そうとすると、403 ステータス コードを含む HTTP 応答が返されます。統合機能の詳細については、機能ガイドを参照してください。
エラー
id
で指定されたブロックが存在しない場合、または統合がブロックにアクセスできない場合は、404 HTTP 応答を返します。
リクエストがリクエスト制限を超えた場合、400 または 429 HTTP レスポンスを返します。
Requestパラメータ
Pathパラメータ
block_id
string
必須
ブロックの識別子
Headerパラメータ
Notion-Version
string
必須
Request Bodyパラメータapplication/json
children
array [object {4}]
必須
ブロック オブジェクトの配列としてコンテナー ブロックに追加する子コンテンツ
object
string
必須
type
string
必須
heading_2
object
可選
paragraph
object
可選
例
{
"children": [
{
"heading_2": {
"text": [
{
"text": {
"content": "Lacinato kale"
},
"type": "text"
}
]
},
"object": "block",
"type": "heading_2"
},
{
"object": "block",
"paragraph": {
"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"
}
},
"type": "text"
}
]
},
"type": "paragraph"
}
]
}
サンプルコード
Response
200 Success - Append block children(200)
200 Success - Append block children
HTTPステータスコード: 200
コンテンツ形式: JSONapplication/json
データ構造
object
string
必須
results
array [object {12}]
必須
object
string
必須
id
string
必須
parent
object
必須
created_time
string
必須
last_edited_time
string
必須
created_by
object
必須
last_edited_by
object
必須
has_children
boolean
必須
archived
boolean
必須
type
string
必須
heading_2
object
可選
paragraph
object
可選
next_cursor
null
必須
has_more
boolean
必須
type
string
必須
block
object
必須
例成功例
{
"object": "list",
"results": [
{
"object": "block",
"id": "c02fc1d3-db8b-45c5-a222-27595b15aea7",
"parent": {
"type": "page_id",
"page_id": "59833787-2cf9-4fdf-8782-e53db20768a5"
},
"created_time": "2022-03-01T19:05:00.000Z",
"last_edited_time": "2022-07-06T19:41:00.000Z",
"created_by": {
"object": "user",
"id": "ee5f0f84-409a-440f-983a-a5315961c6e4"
},
"last_edited_by": {
"object": "user",
"id": "ee5f0f84-409a-440f-983a-a5315961c6e4"
},
"has_children": false,
"archived": false,
"type": "heading_2",
"heading_2": {
"rich_text": [
{
"type": "text",
"text": {
"content": "Lacinato kale",
"link": null
},
"annotations": {
"bold": false,
"italic": false,
"strikethrough": false,
"underline": false,
"code": false,
"color": "default"
},
"plain_text": "Lacinato kale",
"href": null
}
],
"color": "default",
"is_toggleable": false
}
},
{
"object": "block",
"id": "acc7eb06-05cd-4603-a384-5e1e4f1f4e72",
"parent": {
"type": "page_id",
"page_id": "59833787-2cf9-4fdf-8782-e53db20768a5"
},
"created_time": "2022-03-01T19:05:00.000Z",
"last_edited_time": "2022-07-06T19:51:00.000Z",
"created_by": {
"object": "user",
"id": "ee5f0f84-409a-440f-983a-a5315961c6e4"
},
"last_edited_by": {
"object": "user",
"id": "0c3e9826-b8f7-4f73-927d-2caaf86f1103"
},
"has_children": false,
"archived": false,
"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"
}
},
"annotations": {
"bold": false,
"italic": false,
"strikethrough": false,
"underline": false,
"code": false,
"color": "default"
},
"plain_text": "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.",
"href": "https://en.wikipedia.org/wiki/Lacinato_kale"
}
],
"color": "default"
}
}
],
"next_cursor": null,
"has_more": false,
"type": "block",
"block": {}
}
最終更新: 2 years ago