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

Client POST generates a HTTPError #389

Open
thomashirtz opened this issue Jul 3, 2023 · 1 comment
Open

Client POST generates a HTTPError #389

thomashirtz opened this issue Jul 3, 2023 · 1 comment

Comments

@thomashirtz
Copy link

Hello,
As part of a module to clear deleted pages, this piece of code was working fine previously, however now it generates an 400 HTTP Error.

query = {
        'type': 'BlocksInSpace',
        'query': '',
        'filters': {
            'isDeletedOnly': True,
            'excludeTemplates': False,
            'isNavigableOnly': True,
            'requireEditPermissions': False,
            'ancestors': [],
            'createdBy': [],
            'editedBy': [],
            'lastEditedTime': {},
            'createdTime': {},
        },
        'sort': 'Relevance',
        'limit': 1000,
        # 'spaceId': space_id,
        'source': 'trash',
    }
    results = client.post(endpoint='/api/v3/search', data=query)
Traceback (most recent call last):
  File "D:/Thomas/GitHub/notion-clear-trash/notion_clear_trash.py", line 145, in <module>
    raise SystemExit(main())
  File "D:/Thomas/GitHub/notion-clear-trash/notion_clear_trash.py", line 133, in main
    block_id_list = get_trashed_block_id_list(
  File "D:/Thomas/GitHub/notion-clear-trash/notion_clear_trash.py", line 57, in get_trashed_block_id_list
    results = client.post(endpoint='/api/v3/search', data=query)
  File "c:\windows\system32\src\notion\notion\client.py", line 260, in post
    raise HTTPError(
requests.exceptions.HTTPError: Something went wrong. (400)

Did someone has a similar issue and know how to fix it ?

Thank you !

@escarti
Copy link

escarti commented Oct 3, 2023

Solved already by this #385 (comment)

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

2 participants