(日本語版)Notion API - Public Beta
    (日本語版)Notion API - Public Beta
    • 概要
    • インテグレーション機能
    • リクエスト制限
    • ステータス コード
    • ブロック
    • ユーザー
    • コメント
    • リンク プレビューのUnfurl属性オブジェクト
    • バージョン変更
      • バージョニング
      • バージョンによる変更
    • ページ
      • ページ
      • ページのプロパティ
    • データベース
      • データベース
      • データベースのプロパティ
    • その他
      • 絵文字オブジェクト
      • ファイルオブジェクト
      • 親オブジェクト
      • リッチテキストオブジェクト
    • エンドポイント
      • 認証
        • 認証
        • Tokenを作成
      • ブロック
        • ブロックを取得
        • ブロックを更新
        • ブロックの子を取得
        • ブロックの子を追加
        • ブロックを削除
      • データベース
        • データベース エントリのフィルタ
        • データベース エントリの並べ替え
        • データベースのプロパティを更新する
        • データベースを作成
        • データベースを取得
        • データベースを更新
        • データベースにクエリを実行
      • ユーザー
        • 全てユーザーのリストを取得
        • トークンのボットユーザーを取得
        • ユーザーを取得
      • ページ
        • ページをアーカイブ
        • ページを作成
        • ページを取得
        • ページプロパティアイテムを取得
        • ページプロパティを更新
      • コメント
        • コメントを作成
        • コメントを取得
      • 検索
        • タイトルで検索

    ブロック

    ブロック#

    ブロック オブジェクトは、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"
    parentobjectブロックの親に関する情報。親オブジェクト を参照してください。{ "type": "block_id", "block_id": "7d50a184-5bbe-4d90-8f29-6bec57ed817b" }
    typestring(列挙型)ブロックのタイプ。可能な値は次 の とおり です 。 - - - - - - - - - - - - - - - - - - - - - - - - - - -"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_timestring( ISO 8601 日時)このブロックが作成された日時。ISO 8601 日時文字列としてフォーマットされます。"2020-03-17T19:10:04.968Z"
    created_by部分的なユーザーブロックを作成したユーザー。{"object": "user","id": "45ee8d13-687b-47ce-a5ca-6e2e45548c4b"}
    last_edited_timestring( ISO 8601 日時)このブロックが最後に更新された日時。ISO 8601 日時文字列としてフォーマットされます。"2020-03-17T19:10:04.968Z"
    last_edited_by部分的なユーザーブロックを最後に編集したユーザー。{"object": "user","id": "45ee8d13-687b-47ce-a5ca-6e2e45548c4b"}
    archivedbooleanブロックのアーカイブ済みステータス。false
    has_childrenbooleanブロックにネストされた子ブロックがあるかどうか。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リッチ テキスト オブジェクトのarraybulleted_list_itemブロック内のリッチ テキスト。
    colorstring(列挙型)ブロックの色。可能な値は次のとおり です 。 - - - - - - - - - - - - - - - - - -"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ブロック オブジェクトのarraybulleted_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リッチ テキスト オブジェクトのarraycalloutブロック内のリッチ テキスト。
    iconobject吹き出しのアイコンを表す絵文字またはファイルオブジェクト。吹き出しにアイコンがない場合。
    colorstring(列挙型)ブロックの色。可能な値は次のとおり です 。 - - - - - - - - - - - - - - - - - -"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
    フィールドタイプ説明
    titlestringデータベースのプレーン テキスト タイトル。
    例 子データベース ブロック
    {
      //...other keys excluded
      "type": "child_database",
      //...other keys excluded
      "child_database": {
        "title": "My database"
      }
    }

    📘child_databaseブロックの作成と更新#

    child_databaseタイプ ブロックを作成または更新するには、データベースの作成エンドポイントとデータベースの更新エンドポイントを使用し、body パラメーターで親ページの ID を指定します。parent

    子ページ#

    子ページ ブロック オブジェクトには、child_pageプロパティ内に次の情報が含まれています。
    フィールドタイプ説明
    titlestringページのtitleプレーンテキスト。
    例 子ページ ブロック オブジェクト
    {
      //...other keys excluded
      "type": "child_page",
      //...other keys excluded
      "child_page": {
        "title": "Lacinato kale"
      }
    }

    📘child_pageブロックの作成と更新#

    child_pageタイプ ブロックを作成または更新するには、 ページ作成エンドポイントとページ更新エンドポイントを使用し、parentbody パラメーターで親ページの 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のコンテンツを取得するには、次の手順に従います。
    1.
    親ページのブロックの子を取得するためのクエリからcolumn_list IDを取得します。
    2.
    クエリからcolumn子を取得して、column_list のブロックの子を取得します。
    3.
    クエリから各columnのコンテンツを取得して、一意のcolumnID のブロックの子を取得します。

    分周器#

    Divider ブロック オブジェクトには、dividerプロパティ内の情報は含まれません。
    Divider ブロック オブジェクトの例
    {
      //...other keys excluded
      "type": "divider",
      //...other keys excluded
      "divider": {}
    }

    埋め込む#

    埋め込みブロック オブジェクトには、Notion UI 内に表示される別の Web サイトに関する情報が含まれます。embedプロパティには次の情報が含まれます。
    フィールドタイプ説明
    urlstring埋め込みブロックが表示する 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プロパティ内に次の情報が含まれています。
    フィールドタイプ説明
    expressionstringKaTeX 互換の文字列。
    数式オブジェクトの例
    {
      //...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見出しのリッチ テキスト。
    colorstring(列挙型)ブロックの色。可能な値は次のとおり です 。 -"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_toggleableboolean見出しブロックがトグル見出しであるかどうか。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リッチ テキスト オブジェクトのarraynumbered_list_itemブロックに表示されるリッチ テキスト。
    colorstring(列挙型)ブロックの色。可能な値は次のとおり です 。-"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ブロック オブジェクトのarraynumbered_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段落ブロックに表示されるリッチ テキスト。
    colorstring(列挙型)ブロックの色。可能な値は次のとおり です 。 -"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ブロック オブジェクトのarrayparagraphブロックのネストされた子ブロック (存在する場合) 。
    例 段落ブロック オブジェクト
    {
      //...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#

    PDF ブロック オブジェクトは、Notion ページに埋め込まれた PDF を表します。次のフィールドが含まれています。
    プロパティタイプ説明
    captionリッチ テキスト オブジェクトのarrayPDF ブロックのキャプション (提供されている場合)。
    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引用ブロックに表示されるリッチ テキスト。
    colorstring(列挙型)ブロックの色。可能な値は次のとおり です 。 -"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ブロック オブジェクトのarrayquote ブロックのネストされた子ブロック (存在する場合)。
    引用ブロックの例
    {
        //...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_fromnullこの値は常にnullになり、これが別のブロックを参照していない元の同期ブロックであることを示します。
    childrenarrayブロック オブジェクトの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
    フィールドタイプ説明
    typestring(列挙型)同期元オブジェクトのタイプ。 可能な値は次のとおりです。 -"block_id"
    block_idstring(UUIDv4)オリジナルのsynced_blockの識別子。
    例 同期されたブロック オブジェクトを複製する
    {
        //...other keys excluded
        "type": "synced_block",
        "synced_block": {
            "synced_from": {
                "block_id": "original_synced_block_id"
            }
        }
    }

    🚧#

    API は、同期されたブロック コンテンツの更新をサポートしていません。

    テーブル#

    テーブル ブロック オブジェクトは、テーブル行の子の親ブロックです。テーブル ブロック オブジェクトには、プロパティ内に次のフィールドが含まれています。table
    フィールドタイプ説明
    table_widthintegerテーブル内の列の数。 テーブルが作成されると、これはパブリック API を介して変更できないことに注意してください。
    has_column_headerbooleanテーブルに列ヘッダーがあるかどうか。trueの場合、表の最初の行は他の行と視覚的に区別されて表示されます。
    has_row_headerbooleanテーブルにヘッダー行があるかどうか。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を取得します。
    1.
    親ページのブロックの子を取得するためのクエリからtable IDを取得します。
    2.
    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プロパティ内に次の情報が含まれています。
    プロパティタイプ説明
    colorstring(列挙型)ブロックの色。可能な値は次のとおり です 。 -"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リッチ テキスト オブジェクトのarrayTo do ブロックに表示されるリッチ テキスト。
    checkedboolean(オプション)To do がチェックされているかどうか。
    colorstring(列挙型)ブロックの色。可能な値は次のとおり です 。 -"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ブロック オブジェクトのarrayTo 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リッチ テキスト オブジェクトのarrayToggle ブロックに表示されるリッチ テキスト。
    colorstring(列挙型)ブロックの色。可能な値は次のとおり です 。 -"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ブロック オブジェクトのarrayToggle ブロックのネストされた子ブロック (ある場合)。
    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
    更新日時 2023-04-28 06:00:53
    前へ
    ステータス コード
    次へ
    ユーザー
    Built with