GithubHelp home page GithubHelp logo

Comments (8)

yffenim avatar yffenim commented on July 29, 2024

I am getting the exact same issue. All I did was replace the values for token_v2 and the page url with my own exactly as shown in readme.

from notion.client import NotionClient

notion_token_from_header = 'the v2token'
notion_page = 'https://www.notion.so/___/___'

client = NotionClient(token_v2=notion_token_from_header)
print(client) # this part is working

page = client.get_block(notion_page) # this gives error

The error msg:

Traceback (most recent call last):
  File "/Users/emin/Development/for_pamela/notion/script.py", line 75, in <module>
    page = client.get_block(url)
  File "/Users/emin/Development/for_pamela/notion/virtualenv/lib/python3.10/site-packages/notion/client.py", line 169, in get_block
    block = self.get_record_data("block", block_id, force_refresh=force_refresh)
  File "/Users/emin/Development/for_pamela/notion/virtualenv/lib/python3.10/site-packages/notion/client.py", line 162, in get_record_data
    return self._store.get(table, id, force_refresh=force_refresh)
  File "/Users/emin/Development/for_pamela/notion/virtualenv/lib/python3.10/site-packages/notion/store.py", line 184, in get
    self.call_load_page_chunk(id)
  File "/Users/emin/Development/for_pamela/notion/virtualenv/lib/python3.10/site-packages/notion/store.py", line 286, in call_load_page_chunk
    recordmap = self._client.post("loadPageChunk", data).json()["recordMap"]
  File "/Users/emin/Development/for_pamela/notion/virtualenv/lib/python3.10/site-packages/notion/client.py", line 260, in post
    raise HTTPError(
requests.exceptions.HTTPError: Invalid input.

I've ensured that I'm logged in my browser, using token_v2 request cookie from loading the intended page request, and the permissions on the page are private.

Can you address this? Otherwise such a waste of a beautiful sdk.

from notion-py.

tyePhDCandy avatar tyePhDCandy commented on July 29, 2024

I am getting the exact same issue. All I did was replace the values for token_v2 and the page url with my own exactly as shown in readme.
I highly doubt that it's a proxy problem, since we all come from mainland, china. This issue can not be solved by using vpn, it can only be solved by setting proxy server into parameters of certain functions.

from notion-py.

bishalnepali avatar bishalnepali commented on July 29, 2024

Also getting the same issues :(

from notion-py.

egeres avatar egeres commented on July 29, 2024

Is it possible this issue is fixed in this fork? https://github.com/vzhd1701/notion-py

from notion-py.

mhsong55 avatar mhsong55 commented on July 29, 2024

I had the same issue and solved it.
The cause was in the cookie value (token_v2).
I cleared the cookie value in the web browser and refreshed the browser.
After that, I proceeded based on the newly received cookie value, and it worked normally.

from notion-py.

tyePhDCandy avatar tyePhDCandy commented on July 29, 2024

I have already switched to notion-sdk-py and notional. They are both very active repositories.

from notion-py.

williamium3000 avatar williamium3000 commented on July 29, 2024

vpn is not the issue, I am currently US still not working

from notion-py.

williamium3000 avatar williamium3000 commented on July 29, 2024

Hi all,
the issue is solved by https://github.com/vzhd1701/notion-py as stated by @egeres . Thanks
The problem is that the 0.0.36 is not updated to pip, thus directly using pip cannot install the newest version.
My approach is to download from GitHub the source code from https://github.com/vzhd1701/notion-py
and install through
pip install .

from notion-py.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.