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

search_blocks not working? #400

Open
emmby opened this issue Jul 6, 2024 · 0 comments
Open

search_blocks not working? #400

emmby opened this issue Jul 6, 2024 · 0 comments

Comments

@emmby
Copy link

emmby commented Jul 6, 2024

from notion.client import NotionClient

if __name__ == "__main__":
    client = NotionClient(token_v2=...)
    print(client.get_top_level_pages())
    print(client.search_blocks(search='foobar'))

Printing get_top_level_pages() works fine.
Printing search_blocks(search='foobar') results in a 400:

Traceback (most recent call last):
  File "/Users/mike/Documents/GitHub/underline/functions_py/test.py", line 7, in <module>
    print(client.search_blocks(search='underline'))
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mike/Documents/GitHub/underline/functions_py/venv/lib/python3.12/site-packages/notion/client.py", line 321, in search_blocks
    return self.search(query=search, limit=limit)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mike/Documents/GitHub/underline/functions_py/venv/lib/python3.12/site-packages/notion/client.py", line 359, in search
    response = self.post("search", data).json()
               ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mike/Documents/GitHub/underline/functions_py/venv/lib/python3.12/site-packages/notion/client.py", line 260, in post
    raise HTTPError(
requests.exceptions.HTTPError: Something went wrong. (400)

This is using notion-py@c3c9c25

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