view JSON の取得(2) : hkob の雑記録 (487)

はじめに

hkob の雑記録の第488回目(連続61日目)は、各 View の JSON を取得します。今回は後半で残りの view を取得してみます。

Timeline view

7番目は Timeline view です。Timeline view ではどの日付プロパティを利用するのか(date_property_id, date_property_name)、どの日付範囲を選択するのか(zoom_level)などを configuration で指定します。

{
  "object": "view",
  "id": "32fd8e4e-98ab-8050-8d14-000ce4d0b2cc",
  "parent": {
    "type": "database_id",
    "database_id": "32fd8e4e-98ab-80e7-a807-f8fbbf48612d"
  },
  "data_source_id": "32fd8e4e-98ab-8166-98e8-000b4292b61f",
  "name": "TimelineView",
  "type": "timeline",
  "created_time": "2026-03-26T11:36:43.561+00:00",
  "created_by": {
    "object": "user",
    "id": "2200a911-6a96-44bb-bd38-6bfb1e01b9f6"
  },
  "last_edited_time": "2026-05-11T11:38:46.341+00:00",
  "last_edited_by": {
    "object": "user",
    "id": "2200a911-6a96-44bb-bd38-6bfb1e01b9f6"
  },
  "url": "https://www.notion.so/32fd8e4e98ab80e7a807f8fbbf48612d?v=32fd8e4e98ab80508d14000ce4d0b2cc",
  "filter": null,
  "sorts": null,
  "quick_filters": null,
  "configuration": {
    "type": "timeline",
    "date_property_id": "SPrp",
    "date_property_name": "DateTitle",
    "preference": {
      "zoom_level": "month",
      "center_timestamp": 1778499130855.789
    }
  },
  "request_id": "40fe1598-5d22-4f30-9f7d-592048e777aa"
}

Feed view

feedview を取得しようとしたら、unsupported view type となってしまいました。このスクリプトと取得した JSON は消しておきます。

{
  "object": "error",
  "status": 400,
  "code": "validation_error",
  "message": "Unsupported view type: feed",
  "request_id": "1e6c7d45-c7b3-4ea5-a678-7ee36b52823e"
}

Map view

9番目は Map view になります。こちらもどのプロパティで地図を表示するのかが configuration に記載されています。

{
  "object": "view",
  "id": "32fd8e4e-98ab-80cb-897a-000c4beb1978",
  "parent": {
    "type": "database_id",
    "database_id": "32fd8e4e-98ab-80e7-a807-f8fbbf48612d"
  },
  "data_source_id": "32fd8e4e-98ab-8166-98e8-000b4292b61f",
  "name": "MapView",
  "type": "map",
  "created_time": "2026-03-26T11:37:09.629+00:00",
  "created_by": {
    "object": "user",
    "id": "2200a911-6a96-44bb-bd38-6bfb1e01b9f6"
  },
  "last_edited_time": "2026-03-26T11:37:14.626+00:00",
  "last_edited_by": {
    "object": "user",
    "id": "2200a911-6a96-44bb-bd38-6bfb1e01b9f6"
  },
  "url": "https://www.notion.so/32fd8e4e98ab80e7a807f8fbbf48612d?v=32fd8e4e98ab80cb897a000c4beb1978",
  "filter": null,
  "sorts": null,
  "quick_filters": null,
  "configuration": {
    "type": "map",
    "map_by": "Uw=a",
    "map_by_property_name": "PositionTitle"
  },
  "request_id": "c4d9e03d-02c9-4cd3-af7c-547566e865f8"
}

Calendar view

次は Calendar view です。Timeline view と同様にどの日付プロパティを利用するかが configuration で指定します。

{
  "object": "view",
  "id": "32fd8e4e-98ab-80bb-a984-000ca746d6d0",
  "parent": {
    "type": "database_id",
    "database_id": "32fd8e4e-98ab-80e7-a807-f8fbbf48612d"
  },
  "data_source_id": "32fd8e4e-98ab-8166-98e8-000b4292b61f",
  "name": "CalendarView",
  "type": "calendar",
  "created_time": "2026-03-26T11:37:22.162+00:00",
  "created_by": {
    "object": "user",
    "id": "2200a911-6a96-44bb-bd38-6bfb1e01b9f6"
  },
  "last_edited_time": "2026-03-26T11:37:26.743+00:00",
  "last_edited_by": {
    "object": "user",
    "id": "2200a911-6a96-44bb-bd38-6bfb1e01b9f6"
  },
  "url": "https://www.notion.so/32fd8e4e98ab80e7a807f8fbbf48612d?v=32fd8e4e98ab80bba984000ca746d6d0",
  "filter": null,
  "sorts": null,
  "quick_filters": {
    "IFyg": {
      "relation": {
        "is_empty": true
      }
    }
  },
  "configuration": {
    "type": "calendar",
    "date_property_id": "SPrp",
    "date_property_name": "DateTitle",
    "properties": [
      {
        "property_id": "AVX=",
        "property_name": "SubItemTitle",
        "visible": true
      }
    ]
  },
  "request_id": "3dfc75c6-d787-4865-9f45-a1e83f137f0b"
}

FormBuilder view

FormBuilder は form の type があるだけで設定はありません。これを直接 API から作ることはなさそうですね。

{
  "object": "view",
  "id": "32fd8e4e-98ab-8000-81ef-000cd17e0f0c",
  "parent": {
    "type": "database_id",
    "database_id": "32fd8e4e-98ab-80e7-a807-f8fbbf48612d"
  },
  "data_source_id": "32fd8e4e-98ab-8166-98e8-000b4292b61f",
  "name": "FormBuilderView",
  "type": "form",
  "created_time": "2026-03-26T11:37:32.919+00:00",
  "created_by": {
    "object": "user",
    "id": "2200a911-6a96-44bb-bd38-6bfb1e01b9f6"
  },
  "last_edited_time": "2026-03-26T11:38:19.530+00:00",
  "last_edited_by": {
    "object": "user",
    "id": "2200a911-6a96-44bb-bd38-6bfb1e01b9f6"
  },
  "url": "https://www.notion.so/32fd8e4e98ab80e7a807f8fbbf48612d?v=32fd8e4e98ab800081ef000cd17e0f0c",
  "filter": null,
  "sorts": null,
  "quick_filters": null,
  "configuration": {
    "type": "form"
  },
  "request_id": "985ac3a9-f3c7-4765-b238-17cf45d5e8ec"
}

おわりに

今日は、昨日の続きで残りの 4 つの view の JSON を取得しました。Feed view だけは unsupported なので、これは対応しません。

https://hkob.notion.site/hkob-16dd8e4e98ab807cbe3cf3cc94cdfe0f?pvs=4hkob.notion.site