notion-py icon indicating copy to clipboard operation
notion-py copied to clipboard

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

Open Vencent-Won opened this issue 2 years ago • 5 comments

Sorry to disturb you. When I try the example code. client = NotionClient(token_v2="<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.

Vencent-Won avatar Feb 09 '23 11:02 Vencent-Won

I had the same issue.

yxyx724 avatar Feb 28 '23 11:02 yxyx724

Same issue here, any solution?

JorgeHI avatar Apr 05 '23 19:04 JorgeHI

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

Mogby avatar Apr 06 '23 15:04 Mogby

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

quiri86 avatar Apr 03 '24 22:04 quiri86