Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

raise InvalidNotionIdentifier(input_value) #384

Open
robotbird opened this issue Jan 29, 2023 · 0 comments
Open

raise InvalidNotionIdentifier(input_value) #384

robotbird opened this issue Jan 29, 2023 · 0 comments

Comments

@robotbird
Copy link

from notion.client import NotionClient

# Obtain the `token_v2` value by inspecting your browser cookies on a logged-in (non-guest) session on Notion.so
client = NotionClient(token_v2="tonken_from_header")

# Replace this URL with the URL of the page you want to edit
page = client.get_block("https://robotbird.notion.site/test-f4808828a06543aebb115fd03cc700d3")

print("The old title is:", page.title)

# Note: You can use Markdown! We convert on-the-fly to Notion's internal formatted text data structure.
page.title = "The title has now changed, and has *live-updated* in the browser!"

The error message is as follows

Traceback (most recent call last):
  File "/opt/homebrew/lib/python3.10/site-packages/notion/utils.py", line 37, in extract_id
    return str(uuid.UUID(url_or_id))
  File "/opt/homebrew/Cellar/[email protected]/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/uuid.py", line 177, in __init__
    raise ValueError('badly formed hexadecimal UUID string')
ValueError: badly formed hexadecimal UUID string

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/robotbird/Works/yepeng/works/notion4u/test.py", line 7, in <module>
    page = client.get_block("https://robotbird.notion.site/test-f4808828a06543aebb115fd03cc700d3")
  File "/opt/homebrew/lib/python3.10/site-packages/notion/client.py", line 168, in get_block
    block_id = extract_id(url_or_id)
  File "/opt/homebrew/lib/python3.10/site-packages/notion/utils.py", line 39, in extract_id
    raise InvalidNotionIdentifier(input_value)
notion.utils.InvalidNotionIdentifier: https://robotbird.notion.site/test-f4808828a06543aebb115fd03cc700d3

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant