ブロック
ブロック
ブロック オブジェクトは、Notion 内のコンテンツの一部を表します。API は、Notion UI で操作できる見出し、トグル、段落、リスト、メディアなどを、異なるブロック タイプのオブジェクトとして変換します。
たとえば、次のブロック オブジェクトは、Notion UI でHeading 2
を表します。
ブロック オブジェクトの例
{
"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": "green"
},
"plain_text": "Lacinato kale",
"href": null
}
],
"color": "default",
"is_toggleable": false
}
}
ブロックの子の取得エンドポイントを使用して、ページ上のすべてのブロックを一覧表示します。
キー
📘
* でマークされたフィールドは、すべての機能との統合で使用できます。他のプロパティは、Notion API から返されるためにコンテンツ読み取り機能を必要とします。詳細については、統合機能のリファレンスを参照してください。
フィールド | タイプ | 説明 | 例の値 |
---|---|---|---|
object * |
string |
常に"block" |
"block" |
id * |
string (UUIDv4) |
ブロックの識別子。 | "7af38973-3787-41b3-bd75-0ed3a1edfac9" |
parent |
object |
ブロックの親に関する情報。親オブジェクト を参照してください。 | { "type": "block_id", "block_id": "7d50a184-5bbe-4d90-8f29-6bec57ed817b" } |
type |
string (列挙型) |
ブロックのタイプ。可能な値は次 の とおり です 。 - - - - - - - - - - - - - - - - - - - - - - - - - - -"bookmark" "breadcrumb" "bulleted_list_item" "callout" "child_database" "child_page" "column" "column_list" "divider" "embed" "equation" "file" "heading_1" "heading_2" "heading_3" "image" "link_preview" "link_to_page" "numbered_list_item" "paragraph" "pdf" "quote" "synced_block" "table" "table_of_contents" "table_row" "template" "to_do" "toggle" "unsupported" "video" |
"paragraph" |
created_time |
string ( ISO 8601 日時) |
このブロックが作成された日時。ISO 8601 日時文字列としてフォーマットされます。 | "2020-03-17T19:10:04.968Z" |
created_by |
部分的なユーザー | ブロックを作成したユーザー。 | {"object": "user","id": "45ee8d13-687b-47ce-a5ca-6e2e45548c4b"} |
last_edited_time |
string ( ISO 8601 日時) |
このブロックが最後に更新された日時。ISO 8601 日時文字列としてフォーマットされます。 | "2020-03-17T19:10:04.968Z" |
last_edited_by |
部分的なユーザー | ブロックを最後に編集したユーザー。 | {"object": "user","id": "45ee8d13-687b-47ce-a5ca-6e2e45548c4b"} |
archived |
boolean |
ブロックのアーカイブ済みステータス。 | false |
has_children |
boolean |
ブロックにネストされた子ブロックがあるかどうか。 | true |
{type} |
block type object |
タイプ固有のブロック情報を含むオブジェクト。 | 各ブロック タイプの例については、ブロック タイプ オブジェクトのセクションを参照してください。 |
子ブロックをサポートするブロック タイプ
一部のブロック タイプには、ネストされたブロックが含まれます。次のブロック タイプは、子ブロックをサポートします。
- 箇条書き項目
- 叫ぶ
- 子データベース
- 子ページ
- 桁
- 見出し 1、
is_toggleable
プロパティがtrue
の場合 - 見出し 2、
is_toggleable
プロパティがtrue
の場合 - 見出し3、
is_toggleable
プロパティがtrue
の場合 - 番号付きリスト項目
- 段落
- 引用
- 同期ブロック
- テーブル
- レンプレート
- やること
- トグル
📘API はすべてのブロックタイプをサポートしているわけではありません。
以下のリファレンスにリストされているブロック型オブジェクトのみがサポートされています。サポートされていないブロックタイプは構造体に表示されますが、
"unsupported"
に設定されたtype
が含まれています。
ブロック型オブジェクト
すべてのブロック オブジェクトには、 type
の値に対応するキーがあります。キーの下には、タイプ固有のブロック情報を持つオブジェクトがあります。
ブックマーク
ブックマーク ブロック オブジェクトには、bookmark
プロパティ内に次の情報が含まれています。
フィールド | タイプ | 説明 |
---|---|---|
caption |
リッチ テキスト オブジェクトの配列テキスト | ブックマークのキャプションです。 |
url |
列 | ブックマークのリンク先です。 |
ブックマーク ブロック オブジェクトの例
{
//...other keys excluded
"type": "bookmark",
//...other keys excluded
"bookmark": {
"caption": [],
"url": "https://companywebsite.com"
}
}
ブレッドクラム
ブレッドクラム ブロック オブジェクトには、プロパティ内の情報は含まれません。breadcrumb
パンくずブロックオブジェクトの例
{
//...other keys excluded
"type": "breadcrumb",
//...other keys excluded
"breadcrumb": {}
}
箇条書きのリスト項目
箇条書きのリスト項目ブロック オブジェクトには、bulleted_list_item
プロパティ内に次の情報が含まれています。
フィールド | タイプ | 説明 |
---|---|---|
rich_text |
リッチ テキスト オブジェクトのarray |
bulleted_list_item ブロック内のリッチ テキスト。 |
color |
string (列挙型) |
ブロックの色。可能な値は次のとおり です 。 - - - - - - - - - - - - - - - - - -"blue" "blue_background" "brown" "brown_background" "default" "gray" "gray_background" "green" "green_background" "orange" "orange_background" "yellow" "green" "pink" "pink_background" "purple" "purple_background" "red" "red_background" "yellow_background" |
children |
ブロック オブジェクトのarray |
bulleted_list_item ブロックのネストされた子ブロック (存在する場合) 。 |
例 箇条書き項目ブロック オブジェクト
{
//...other keys excluded
"type": "bulleted_list_item",
//...other keys excluded
"bulleted_list_item": {
"rich_text": [{
"type": "text",
"text": {
"content": "Lacinato kale",
"link": null
}
// ..other keys excluded
}],
"color": "default",
"children":[{
"type": "paragraph"
// ..other keys excluded
}]
}
}
コールアウト
コールアウトブロック オブジェクトには、callout
プロパティ内に次の情報が含まれています。
フィールド | タイプ | 説明 |
---|---|---|
rich_text |
リッチ テキスト オブジェクトのarray |
callout ブロック内のリッチ テキスト。 |
icon |
object |
吹き出しのアイコンを表す絵文字またはファイルオブジェクト。吹き出しにアイコンがない場合。 |
color |
string (列挙型) |
ブロックの色。可能な値は次のとおり です 。 - - - - - - - - - - - - - - - - - -"blue" "blue_background" "brown" "brown_background" "default" "gray" "gray_background" "green" "green_background" "orange" "orange_background" "yellow" "green" "pink" "pink_background" "purple" "purple_background" "red" "red_background" "yellow_background" |
コールアウトブロックオブジェクトの例
{
//...other keys excluded
"type": "callout",
// ..other keys excluded
"callout": {
"rich_text": [{
"type": "text",
"text": {
"content": "Lacinato kale",
"link": null
}
// ..other keys excluded
}],
"icon": {
"emoji": "⭐"
},
"color": "default"
}
}
子データベース
子データベース ブロック オブジェクトには、プロパティ内に次の情報が含まれています。child_database
フィールド | タイプ | 説明 |
---|---|---|
title |
string |
データベースのプレーン テキスト タイトル。 |
例 子データベース ブロック
{
//...other keys excluded
"type": "child_database",
//...other keys excluded
"child_database": {
"title": "My database"
}
}
📘
child_database
ブロックの作成と更新
child_database
タイプ ブロックを作成または更新するには、データベースの作成エンドポイントとデータベースの更新エンドポイントを使用し、body パラメーターで親ページの ID を指定します。parent
子ページ
子ページ ブロック オブジェクトには、child_page
プロパティ内に次の情報が含まれています。
フィールド | タイプ | 説明 |
---|---|---|
title |
string |
ページのtitle プレーンテキスト。 |
例 子ページ ブロック オブジェクト
{
//...other keys excluded
"type": "child_page",
//...other keys excluded
"child_page": {
"title": "Lacinato kale"
}
}
📘
child_page
ブロックの作成と更新
child_page
タイプ ブロックを作成または更新するには、 ページ作成エンドポイントとページ更新エンドポイントを使用し、parent
body パラメーターで親ページの ID を指定します。
コード
コード ブロック オブジェクトには、code
プロパティ内に次の情報が含まれています。
フィールド | タイプ | 説明 |
---|---|---|
caption |
リッチ テキスト オブジェクトのテキスト オブジェクトのarray |
コード ブロックのキャプションのリッチ テキスト。 |
rich_text |
リッチ テキスト オブジェクトのテキスト オブジェクトのarray |
コード ブロック内のリッチ テキスト。 |
language |
"abap" "arduino" "bash" "basic" "c" "clojure" "coffeescript" "c++" "c#" "css" "dart" "diff" "docker" "elixir" "elm" "erlang" "flow" "fortran" "f#" "gherkin" "glsl" "go" "graphql" "groovy" "haskell" "html" "java" "javascript" "json" "julia" "kotlin" "latex" "less" "lisp" "livescript" "lua" "makefile" "markdown" "markup" "matlab" "mermaid" "nix" "objective-c" "ocaml" "pascal" "perl" "php" "plain text" "powershell" "prolog" "protobuf" "python" "r" "reason" "ruby" "rust" "sass" "scala" "scheme" "scss" "shell" "sql" "swift" "typescript" "vb.net" "verilog" "vhdl" "visual basic" "webassembly" "xml" "yaml" "java/c/c++/c#" |
コード ブロックに含まれるコードの言語。 |
例 コード ブロック オブジェクト
{
//...other keys excluded
"type": "code",
//...other keys excluded
"code": {
"caption": [],
"rich_text": [{
"type": "text",
"text": {
"content": "const a = 3"
}
}],
"language": "javascript"
}
}
列リストと列
列リストは、列の親ブロックです。column_list
プロパティ内の情報は含まれません。
例 列リストブロックオブジェクト
{
//...other keys excluded
"type": "column_list",
//...other keys excluded
"column_list": {}
}
列は、他の column
を除いて、このリファレンスにリストされているすべてのブロック タイプの親ブロックです。column
プロパティ内の情報は含まれません。それらはcolumn_list
s にのみ追加できます。
例 列オブジェクト
{
//...other keys excluded
"type": "column",
//...other keys excluded
"column": {}
}
Append block childrenを使用してcolumn_list
ブロックを作成する場合、 column_list
には少なくとも 2 つのcolumn
が必要であり、column
それぞれに少なくとも 1 つの子が必要です。
列リストのコンテンツを取得する
column_list
のコンテンツを取得するには、次の手順に従います。
- 親ページのブロックの子を取得するためのクエリから
column_list
IDを取得します。 - クエリから
column
子を取得して、column_list
のブロックの子を取得します。 - クエリから各
column
のコンテンツを取得して、一意のcolumn
ID のブロックの子を取得します。
分周器
Divider ブロック オブジェクトには、divider
プロパティ内の情報は含まれません。
Divider ブロック オブジェクトの例
{
//...other keys excluded
"type": "divider",
//...other keys excluded
"divider": {}
}
埋め込む
埋め込みブロック オブジェクトには、Notion UI 内に表示される別の Web サイトに関する情報が含まれます。embed
プロパティには次の情報が含まれます。
フィールド | タイプ | 説明 |
---|---|---|
url |
string |
埋め込みブロックが表示する Web サイトへのリンク。 |
例 埋め込みブロック オブジェクト
{
//...other keys excluded
"type": "embed",
//...other keys excluded
"embed": {
"url": "https://companywebsite.com"
}
}
🚧Notion アプリと API の埋め込みブロックの違い
Notion アプリは、サードパーティのサービスである iFramely を使用して、指定された URL の埋め込みのメタデータを検証および要求します。これは Web アプリでうまく機能します。これは、Notion が完了するまでに数秒以上かかる場合がある URL 情報の非同期リクエストを開始し、iFramely からのレスポンスを受信した後、UI でメタデータを使用してブロックを更新できるためです。
API で埋め込みブロックを作成するときに iFramely を呼び出さないことにしました。これは、API が UI よりも速く返せるようにする必要があり、iFramely からの応答によって実際にブロック タイプが変更される可能性があるためです。これにより、応答のブロックが要求で送信されたブロックと一致しないため、処理が遅くなり、混乱を招く可能性があります。
その結果、API を介して作成された埋め込みブロックは、Notion アプリで作成された対応するものとまったく同じに見えない場合があります。
方程式
数式ブロック オブジェクトは、段落ブロックの子として表されます。これらはリッチ テキスト オブジェクト内にネストされており、equation
プロパティ内に次の情報が含まれています。
フィールド | タイプ | 説明 |
---|---|---|
expression |
string |
KaTeX 互換の文字列。 |
数式オブジェクトの例
{
//...other keys excluded
"type": "equation",
//...other keys excluded
"equation": {
"expression": "e=mc^2"
}
}
ファイル
ファイル ブロック オブジェクトには、file
プロパティ内に次の情報が含まれています。
フィールド | タイプ | 説明 |
---|---|---|
caption |
リッチ テキスト オブジェクトのarray |
ファイル ブロックのキャプション。 |
type |
"file" "external" |
定数文字列。 |
file |
ファイルオブジェクト | ブロックに含まれるファイルに関する詳細情報を示すファイル オブジェクト。 |
例 File オブジェクト
{
//...other keys excluded
"type": "file",
//...other keys excluded
"file": {
"caption": [],
"type": "external",
"external": {
"url": "https://companywebsite.com/files/doc.txt"
}
}
}
見出し
すべての見出しブロック オブジェクト、heading_1
、heading_2
、およびheading_3
には、対応するオブジェクト内に次の情報が含まれています。
フィールド | タイプ | 説明 |
---|---|---|
rich_text |
リッチ テキスト オブジェクトのarray |
見出しのリッチ テキスト。 |
color |
string (列挙型) |
ブロックの色。可能な値は次のとおり です 。 -"blue" "blue_background" "brown" "brown_background" "default" "gray" "gray_background" "green" "green_background" "orange" "orange_background" "yellow" "green" "pink" "pink_background" "purple" "purple_background" "red" "red_background" "yellow_background" |
is_toggleable |
boolean |
見出しブロックがトグル見出しであるかどうか。true の場合、見出しブロックが切り替わり、子をサポートできます。false の場合、見出しブロックは静的見出しブロックです。 |
例 見出し 1 ブロック オブジェクト
{
//...other keys excluded
"type": "heading_1",
//...other keys excluded
"heading_1": {
"rich_text": [{
"type": "text",
"text": {
"content": "Lacinato kale",
"link": null
}
}],
"color": "default",
"is_toggleable": false
}
}
例 見出し 2 ブロック オブジェクト
{
//...other keys excluded
"type": "heading_2",
//...other keys excluded
"heading_2": {
"rich_text": [{
"type": "text",
"text": {
"content": "Lacinato kale",
"link": null
}
}],
"color": "default",
"is_toggleable": false
}
}
例 見出し 3 ブロック オブジェクト
{
//...other keys excluded
"type": "heading_3",
//...other keys excluded
"heading_3": {
"rich_text": [{
"type": "text",
"text": {
"content": "Lacinato kale",
"link": null
}
}],
"color": "default",
"is_toggleable": false
}
}
画像
画像ブロック オブジェクトには、画像に関する情報を詳述するファイル オブジェクトが含まれます。
例 Image ブロック オブジェクト
{
//...other keys excluded
"type": "image",
//...other keys excluded
"image": {
"type": "external",
"external": {
"url": "https://website.domain/images/image.png"
}
}
}
サポートされている画像の種類
イメージは直接ホストされている必要があります。つまり、url
は画像を取得するサービスを指すことはできません。次の画像タイプがサポートされています。
.bmp
.gif
.heic
.jpeg
.jpg
.png
.svg
.tif
.tiff
リンクのプレビュー
リンク プレビューブロック オブジェクトには、最初に貼り付けたurl
が含まれています。
例 リンク プレビュー ブロック オブジェクト
{
//...other keys excluded
"type": "link_preview",
//...other keys excluded
"link_preview": {
"url": "https://github.com/example/example-repo/pull/1234"
}
}
🚧
link_preview
ブロックは、レスポンスの一部としてのみ返すことができます。API は、link_preview
ブロックの作成または追加をサポートしていません。
メンション(言及)
メンション ブロック オブジェクトは、段落ブロック オブジェクト内にネストされたリッチ テキストオブジェクトの子です。このブロック タイプは、ユーザー、日付、Notion ページ、Notion データベース、またはリンク プレビューの縮小版の Notion UI の任意の@
タグを表します。
メンション ブロック オブジェクトには、次のフィールドが含まれます。
フィールド | タイプ | 説明 |
---|---|---|
type |
"database" "date" "link_preview" "page" "user" |
メンションのタイプを表す定数文字列。 |
"database" "date" "link_preview" "page" "user" |
object |
メンションに関するタイプ固有の情報を持つオブジェクト。 |
例 言及オブジェクト
{
//...other keys excluded
"type": "page",
"page": {
"id": "3c612f56-fdd0-4a30-a4d6-bda7d7426309"
}
}
番号付きリスト項目
番号付きリスト項目ブロック オブジェクトには、numbered_list_item
プロパティ内に次の情報が含まれています。
フィールド | タイプ | 説明 |
---|---|---|
rich_text |
リッチ テキスト オブジェクトのarray |
numbered_list_item ブロックに表示されるリッチ テキスト。 |
color |
string (列挙型) |
ブロックの色。可能な値は次のとおり です 。-"blue" "blue_background" "brown" "brown_background" "default" "gray" "gray_background" "green" "green_background" "orange" "orange_background" "yellow" "green" "pink" "pink_background" "purple" "purple_background" "red" "red_background" "yellow_background" |
children |
ブロック オブジェクトのarray |
numbered_list_item ブロックのネストされた子ブロック (存在する場合) 。 |
例 番号付きリスト項目ブロック
{
//...other keys excluded
"type": "numbered_list_item",
"numbered_list_item": {
"rich_text": [
{
"type": "text",
"text": {
"content": "Finish reading the docs",
"link": null
}
}
],
"color": "default"
}
}
段落
段落ブロック オブジェクトには、paragraph
プロパティ内に次の情報が含まれています。
フィールド | タイプ | 説明 |
---|---|---|
rich_text |
リッチ テキスト オブジェクトのarray |
段落ブロックに表示されるリッチ テキスト。 |
color |
string (列挙型) |
ブロックの色。可能な値は次のとおり です 。 -"blue" "blue_background" "brown" "brown_background" "default" "gray" "gray_background" "green" "green_background" "orange" "orange_background" "yellow" "green" "pink" "pink_background" "purple" "purple_background" "red" "red_background" "yellow_background" |
children |
ブロック オブジェクトのarray |
paragraph ブロックのネストされた子ブロック (存在する場合) 。 |
例 段落ブロック オブジェクト
{
//...other keys excluded
"type": "paragraph",
//...other keys excluded
"paragraph": {
"rich_text": [{
"type": "text",
"text": {
"content": "Lacinato kale",
"link": null
}
}],
"color": "default"
}
子メンション ブロック オブジェクトを持つ段落ブロック オブジェクトの例
{
//...other keys excluded
"type": "paragraph",
"paragraph":{
"rich_text": [
{
"type": "mention",
"mention": {
"type": "date",
"date": {
"start": "2023-03-01",
"end": null,
"time_zone": null
}
},
"annotations": {
"bold": false,
"italic": false,
"strikethrough": false,
"underline": false,
"code": false,
"color": "default"
},
"plain_text": "2023-03-01",
"href": null
},
{
"type": "text",
"text": {
"content": " ",
"link": null
},
"annotations": {
"bold": false,
"italic": false,
"strikethrough": false,
"underline": false,
"code": false,
"color": "default"
},
"plain_text": " ",
"href": null
}
],
"color": "default"
}
}
PDF ブロック オブジェクトは、Notion ページに埋め込まれた PDF を表します。次のフィールドが含まれています。
プロパティ | タイプ | 説明 |
---|---|---|
caption |
リッチ テキスト オブジェクトのarray |
PDF ブロックのキャプション (提供されている場合)。 |
type |
"external" "file" |
PDF のタイプを表す定数文字列。file は Notion がホストするファイルを示し、external はサードパーティのリンクを表します。 |
external file |
ファイルオブジェクト | PDF に関するタイプ固有の情報を含むオブジェクト。 |
JSON
{
//...other keys excluded
"type": "pdf",
//...other keys excluded
"pdf": {
"type": "external",
"external": {
"url": "https://website.domain/files/doc.pdf"
}
}
}
引用
引用ブロック オブジェクトには、quote
プロパティ内に次の情報が含まれています。
フィールド | タイプ | 説明 |
---|---|---|
rich_text |
リッチ テキスト オブジェクトのarray |
引用ブロックに表示されるリッチ テキスト。 |
color |
string (列挙型) |
ブロックの色。可能な値は次のとおり です 。 -"blue" "blue_background" "brown" "brown_background" "default" "gray" "gray_background" "green" "green_background" "orange" "orange_background" "yellow" "green" "pink" "pink_background" "purple" "purple_background" "red" "red_background" "yellow_background" |
children |
ブロック オブジェクトのarray |
quote ブロックのネストされた子ブロック (存在する場合)。 |
引用ブロックの例
{
//...other keys excluded
"type": "quote",
//...other keys excluded
"quote": {
"rich_text": [{
"type": "text",
"text": {
"content": "To be or not to be...",
"link": null
},
//...other keys excluded
}],
//...other keys excluded
"color": "default"
}
}
同期ブロック
Notion UI と同様に、synced_block
オブジェクトには 2 つのバージョンがあります。最初に作成され、まだ他のブロックと同期されていない元のブロックと、元のブロックと同期された複製ブロックです。
📘
対応する複製ブロックまたはブロックを作成する前に、元の同期ブロックを作成する必要があります。
元の同期ブロック
元の同期ブロック オブジェクトには、synced_block
プロパティ内に次の情報が含まれています。
フィールド | タイプ | 説明 |
---|---|---|
synced_from |
null |
この値は常にnull になり、これが別のブロックを参照していない元の同期ブロックであることを示します。 |
children |
array ブロック オブジェクトの |
synced_block ブロックのネストされた子ブロック (存在する場合) 。これらのブロックは複製されたsynced_block でミラー化されます。 |
例 元の同期ブロック
{
//...other keys excluded
"type": "synced_block",
"synced_block": {
"synced_from": null,
"children": [
{
"callout": {
"rich_text": [
{
"type": "text",
"text": {
"content": "Callout in synced block"
}
}
]
}
}
]
}
}
同期ブロックの複製
重複した同期ブロック オブジェクトには、オブジェクト内に次の情報が含まれています。synced_from
フィールド | タイプ | 説明 |
---|---|---|
type |
string (列挙型) |
同期元オブジェクトのタイプ。 可能な値は次のとおりです。 -"block_id" |
block_id |
string (UUIDv4) |
オリジナルのsynced_block の識別子。 |
例 同期されたブロック オブジェクトを複製する
{
//...other keys excluded
"type": "synced_block",
"synced_block": {
"synced_from": {
"block_id": "original_synced_block_id"
}
}
}
🚧
API は、同期されたブロック コンテンツの更新をサポートしていません。
テーブル
テーブル ブロック オブジェクトは、テーブル行の子の親ブロックです。テーブル ブロック オブジェクトには、プロパティ内に次のフィールドが含まれています。table
フィールド | タイプ | 説明 |
---|---|---|
table_width |
integer |
テーブル内の列の数。 テーブルが作成されると、これはパブリック API を介して変更できないことに注意してください。 |
has_column_header |
boolean |
テーブルに列ヘッダーがあるかどうか。true の場合、表の最初の行は他の行と視覚的に区別されて表示されます。 |
has_row_header |
boolean |
テーブルにヘッダー行があるかどうか。true の場合、テーブルの最初の列は他の列とは視覚的に区別されます。 |
例 Table ブロック オブジェクト
{
//...other keys excluded
"type": "table",
"table": {
"table_width": 2,
"has_column_header": false,
"has_row_header": false
}
}
🚧テーブルが最初に作成されたときにのみ
table_width
を設定できます。テーブルの列数は、テーブルが最初に作成されたときにのみ設定できることに注意してください。
table_width
を更新する Update ブロック エンドポイントの呼び出しは失敗します。
表の行
次の手順に従って、table
のtable_row
を取得します。
- 親ページのブロックの子を取得するためのクエリから
table
IDを取得します。 table
のブロックの子を取得するクエリからtable_rows
を取得します。
table_row
ブロックオブジェクトには、table_row
プロパティ内の次のフィールドが含まれます。
プロパティ | タイプ | 説明 |
---|---|---|
cells |
リッチ テキスト オブジェクトの配列array |
横方向の表示順のセル コンテンツの配列。各セルは、リッチ テキスト オブジェクトの配列です。 |
例 テーブル行ブロック オブジェクト
{
//...other keys excluded
"type": "table_row",
"table_row": {
"cells": [
[
{
"type": "text",
"text": {
"content": "column 1 content",
"link": null
},
"annotations": {
"bold": false,
"italic": false,
"strikethrough": false,
"underline": false,
"code": false,
"color": "default"
},
"plain_text": "column 1 content",
"href": null
}
],
[
{
"type": "text",
"text": {
"content": "column 2 content",
"link": null
},
"annotations": {
"bold": false,
"italic": false,
"strikethrough": false,
"underline": false,
"code": false,
"color": "default"
},
"plain_text": "column 2 content",
"href": null
}
],
[
{
"type": "text",
"text": {
"content": "column 3 content",
"link": null
},
"annotations": {
"bold": false,
"italic": false,
"strikethrough": false,
"underline": false,
"code": false,
"color": "default"
},
"plain_text": "column 3 content",
"href": null
}
]
]
}
}
📘
Append ブロックの子エンドポイントを介してテーブル ブロックを作成する場合、
table
には、table_width
と同じ長さのcells
配列を持つtable_row
ブロックが少なくとも 1 つが必要です。
目次
目次ブロック オブジェクトには、table_of_contents
プロパティ内に次の情報が含まれています。
プロパティ | タイプ | 説明 |
---|---|---|
color |
string (列挙型) |
ブロックの色。可能な値は次のとおり です 。 -"blue" "blue_background" "brown" "brown_background" "default" "gray" "gray_background" "green" "green_background" "orange" "orange_background" "yellow" "green" "pink" "pink_background" "purple" "purple_background" "red" "red_background" "yellow_background" |
目次ブロック オブジェクトの例
{
//...other keys excluded
"type": "table_of_contents",
"table_of_contents": {
"color": "default"
}
}
レンプレート
❗️非推奨通知
2023 年 3 月 27 日以降、テンプレート ブロックの作成はサポートされなくなります。
テンプレート ブロックは、Notion UI のテンプレート ボタンを表します。
テンプレート ブロック オブジェクトには、template
プロパティ内に次の情報が含まれています。
フィールド | タイプ | 説明 |
---|---|---|
rich_text |
リッチ テキスト オブジェクトのarray |
テンプレートのタイトルに表示されるリッチ テキスト。 |
children |
ブロック オブジェクトのarray |
テンプレート ブロックのネストされた子ブロック (存在する場合)。テンプレート ブロックが UI で使用されると、これらのブロックが複製されます。 |
例 Template ブロック オブジェクト
{
//...other keys excluded
"template": {
"rich_text": [
{
"type": "text",
"text": {
"content": "Add a new to-do",
"link": null
},
"annotations": {
//...other keys excluded
},
"plain_text": "Add a new to-do",
"href": null
}
]
}
}
To do
To do ブロック オブジェクトには、プロパティ内に次の情報が含まれています。to_do
フィールド | タイプ | 説明 |
---|---|---|
rich_text |
リッチ テキスト オブジェクトのarray |
To do ブロックに表示されるリッチ テキスト。 |
checked |
boolean (オプション) |
To do がチェックされているかどうか。 |
color |
string (列挙型) |
ブロックの色。可能な値は次のとおり です 。 -"blue" "blue_background" "brown" "brown_background" "default" "gray" "gray_background" "green" "green_background" "orange" "orange_background" "yellow" "green" "pink" "pink_background" "purple" "purple_background" "red" "red_background" "yellow_background" |
children |
ブロック オブジェクトのarray |
To do ブロックのネストされた子ブロック (ある場合)。 |
例 To do ブロックオブジェクト
{
//...other keys excluded
"type": "to_do",
"to_do": {
"rich_text": [{
"type": "text",
"text": {
"content": "Finish Q3 goals",
"link": null
}
}],
"checked": false,
"color": "default",
"children":[{
"type": "paragraph"
// ..other keys excluded
}]
}
}
ブロックの切り替え
トグル ブロック オブジェクトには、toggle
プロパティ内に次の情報が含まれています。
フィールド | タイプ | 説明 |
---|---|---|
rich_text |
リッチ テキスト オブジェクトのarray |
Toggle ブロックに表示されるリッチ テキスト。 |
color |
string (列挙型) |
ブロックの色。可能な値は次のとおり です 。 -"blue" "blue_background" "brown" "brown_background" "default" "gray" "gray_background" "green" "green_background" "orange" "orange_background" "yellow" "green" "pink" "pink_background" "purple" "purple_background" "red" "red_background" "yellow_background" |
children |
ブロック オブジェクトのarray |
Toggle ブロックのネストされた子ブロック (ある場合)。 |
Toggleブロック
{
//...other keys excluded
"type": "toggle",
"toggle": {
"rich_text": [{
"type": "text",
"text": {
"content": "Additional project details",
"link": null
}
//...other keys excluded
}],
"color": "default",
"children":[{
"type": "paragraph"
// ..other keys excluded
}]
}
}
ビデオ
ビデオ ブロック オブジェクトには、画像に関する情報を詳述するファイル オブジェクトが含まれます。
例 ビデオ ブロック オブジェクト
{
"type": "video",
//...other keys excluded
"video": {
"type": "external",
"external": {
"url": "https://companywebsite.com/files/video.mp4"
}
}
}
サポートされているビデオの種類
.amv
.asf
.avi
.f4v
.flv
.gifv
.mkv
.mov
.mpg
.mpeg
.mpv
.mp4
.m4v
.qt
.wmv