データベースオブジェクト が web address を
url
キーとして返すようになった。確認のためにこのページを取得してみる。
#!/bin/sh curl -X POST 'https://api.notion.com/v1/search' \ -H 'Authorization: Bearer '"$NOTION_API_KEY"'' \ -H 'Content-Type: application/json' \ -H "Notion-Version: 2021-08-16" \ --data '{ "query":"url を保持", "sort":{ "direction":"ascending", "timestamp":"last_edited_time" } }'
返ってきた JSON を確認すると、url key が存在していることがわかる。
{ "object": "list", "results": [ { "object": "page", "id": "1a2d2142-8efe-43d5-adaa-1ff18c6588cc", "created_time": "2021-11-10T22:23:00.000Z", "last_edited_time": "2021-11-10T22:26:00.000Z", "cover": null, "icon": null, "parent": { "type": "database_id", "database_id": "c63c00ad-201d-4bed-82b0-18dfca9b6ba0" }, "archived": false, "properties": { "開示?": { "id": "%3BfBx", "type": "checkbox", "checkbox": false }, "日付": { "id": "%3CWbe", "type": "date", "date": { "start": "2021-09-23", "end": null } }, "原題": { "id": "%3FMR%7D", "type": "rich_text", "rich_text": [ { "type": "text", "text": { "content": "Database objects now contain url", "link": null }, "annotations": { "bold": false, "italic": false, "strikethrough": false, "underline": false, "code": false, "color": "default" }, "plain_text": "Database objects now contain url", "href": null } ] }, "URL": { "id": "o%3A~F", "type": "url", "url": "https://developers.notion.com/changelog/database-objects-now-contain-url" }, "タグ": { "id": "tUJV", "type": "multi_select", "multi_select": [ { "id": "05f3b6b1-b6f1-49a2-bbdb-955cfb4d36f4", "name": "IMPROVED", "color": "gray" } ] }, "経過日数": { "id": "~Xof", "type": "formula", "formula": { "type": "number", "number": 48 } }, "名前": { "id": "title", "type": "title", "title": [ { "type": "text", "text": { "content": "データベースオブジェクトが url を保持するようになった", "link": null }, "annotations": { "bold": false, "italic": false, "strikethrough": false, "underline": false, "code": false, "color": "default" }, "plain_text": "データベースオブジェクトが url を保持するようになった", "href": null } ] } }, "url": "https://www.notion.so/url-1a2d21428efe43d5adaa1ff18c6588cc" } ], "next_cursor": null, "has_more": false }
Notion API Changelog まとめ