How do I get my Python code to pass the authorization needed for it to connect to Notion

30 views Asked by At

I am trying to write my own code that will manually add blocks and data to my notion workspace. I added the API token and the URL needed for it to work but I still have no success whatsoever. I'm new to python so any help will be much appreciated this is my starting code:

from notion.client import NotionClient

Notion_token = "..."
page_url="https://www.notion.so/..."

client = NotionClient(token_v2=Notion_token)

page = client.get_block(page_url)

text_block = page.children.add_new("text")

text_block.title = "Test"

If someone is willing to contact me and help me guide through it I will be forever grateful. I've seen some comments on other posts here that Notion has apparently tightened the security and simple requests don't pass the authorization process

0

There are 0 answers