Last active
March 27, 2024 17:06
-
-
Save ftnext/a00c0f049fc6624f677822b14e14aece to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from notion_client import Client | |
parent_page_id = "ID from URL (pageをintegrationにコネクト)" | |
notion = Client(auth=os.environ["NOTION_TOKEN"]) # integration secret | |
new_page = notion.pages.create( | |
parent={"type": "page_id", "page_id": parent_page_id}, | |
properties={ | |
"title": {"title": [{"text": {"content": "notion-clientで作成"}}]} | |
}, | |
children=[ | |
{ | |
"object": "block", | |
"type": "paragraph", | |
"paragraph": { | |
"rich_text": [ | |
{ | |
"type": "text", | |
"text": {"content": "Hello World\nこんにちは"}, | |
} | |
] | |
}, | |
} | |
], | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment