ブロック
ブロック
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 | タイプ固有のブロック情報を含むオブジェクト。 | 各ブロック タイプの例については、ブロック タイプ オブジェクトのセクションを参照してください。 |
子ブロックをサポートするブロック タイプ
📘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": {}
}
column_list
ブロックを作成する場合、 column_list
には少なくとも 2 つのcolumn
が必要であり、column
それぞれに少なくとも 1 つの子が必要です。列リストのコンテンツを取得する
column_list
のコンテンツを取得するには、次の手順に従います。1.
column_list
IDを取得します。2.
column
子を取得して、column_list
のブロックの子を取得します。3.
column
のコンテンツを取得して、一意のcolumn
ID のブロックの子を取得します。分周器
divider
プロパティ内の情報は含まれません。{
//...other keys excluded
"type": "divider",
//...other keys excluded
"divider": {}
}
埋め込む
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 | ファイルオブジェクト | ブロックに含まれるファイルに関する詳細情報を示すファイル オブジェクト。 |
{
//...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 の場合、見出しブロックは静的見出しブロックです。 |
{
//...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
}
}
{
//...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
}
}
{
//...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
}
}
画像
{
//...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
ブロックの作成または追加をサポートしていません。
メンション(言及)
@
タグを表します。フィールド | タイプ | 説明 |
---|---|---|
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"
}
}
プロパティ | タイプ | 説明 |
---|---|---|
caption | リッチ テキスト オブジェクトのarray | PDF ブロックのキャプション (提供されている場合)。 |
type | "external" "file" | PDF のタイプを表す定数文字列。file は Notion がホストするファイルを示し、external はサードパーティのリンクを表します。 |
external file | ファイルオブジェクト | PDF に関するタイプ固有の情報を含むオブジェクト。 |
{
//...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"
}
}
同期ブロック
synced_block
オブジェクトには 2 つのバージョンがあります。最初に作成され、まだ他のブロックと同期されていない元のブロックと、元のブロックと同期された複製ブロックです。📘
対応する複製ブロックまたはブロックを作成する前に、元の同期ブロックを作成する必要があります。
元の同期ブロック
synced_block
プロパティ内に次の情報が含まれています。フィールド | タイプ | 説明 |
---|---|---|
synced_from | null | この値は常にnull になり、これが別のブロックを参照していない元の同期ブロックであることを示します。 |
children | array |