jamalex / notion-py

Unofficial Python API client for Notion.so
MIT License
4.28k stars 476 forks source link

Help!!! requests.exceptions.HTTPError: Invalid input. #385

Open Vencent-Won opened 1 year ago

Vencent-Won commented 1 year ago

Sorry to disturb you. When I try the example code. client = NotionClient(token_v2="") page = client.get_block("")

Then, it came out the error that: Traceback (most recent call last): File "D:\program files\JetBrains\PyCharm 2021.3.2\plugins\python\helpers\pydev\pydevd.py", line 1483, in _exec pydev_imports.execfile(file, globals, locals) # execute the script File "D:\program files\JetBrains\PyCharm 2021.3.2\plugins\python\helpers\pydev_pydev_imps_pydev_execfile.py", line 18, in execfile exec(compile(contents+"\n", file, 'exec'), glob, loc) File "D:/Users/Vencent-Won/PycharmProjects/mark2notion/main.py", line 9, in page = client.get_block("https://www.notion.so/Paper-Reading-Notes-2d79e4bcb83b4c22a7e054cd9bb6634a") File "C:\Users\Vencent-Won\AppData\Roaming\Python\Python37\site-packages\notion\client.py", line 169, in get_block block = self.get_record_data("block", block_id, force_refresh=force_refresh) File "C:\Users\Vencent-Won\AppData\Roaming\Python\Python37\site-packages\notion\client.py", line 162, in get_record_data return self._store.get(table, id, force_refresh=force_refresh) File "C:\Users\Vencent-Won\AppData\Roaming\Python\Python37\site-packages\notion\store.py", line 184, in get self.call_load_page_chunk(id) File "C:\Users\Vencent-Won\AppData\Roaming\Python\Python37\site-packages\notion\store.py", line 286, in call_load_page_chunk recordmap = self._client.post("loadPageChunk", data).json()["recordMap"] File "C:\Users\Vencent-Won\AppData\Roaming\Python\Python37\site-packages\notion\client.py", line 262, in post "message", "There was an error (400) submitting the request." requests.exceptions.HTTPError: Invalid input.

yxyx724 commented 1 year ago

I had the same issue.

JorgeHI commented 1 year ago

Same issue here, any solution?

Mogby commented 1 year ago

Found solution here: https://github.com/paperboi/kindle2notion/issues/14

quiri86 commented 5 months ago

Didn't work for me, line 280 seems to have been amended in the package alraedy