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

Error while running example "first_project"

Open mccorkle opened this issue 1 year ago • 5 comments

When running the first_project example -- I got the following errors when attempting to filter by name:

  • httpx.HTTPStatusError: Client error '400 Bad Request'
  • notion_client.errors.APIResponseError: body failed validation. Fix one: {it then went on to list all of the body.filter types I could have provided}

The error is somewhere around this line:

  • https://github.com/ramnes/notion-sdk-py/blob/0058b8db15cf021f3118a74fb371892afbb8b998/examples/first_project/script.py#L59

According to the documentation on developers.notion.com -- the filter object currently does not accept text as a type filter -- only rich_text:

  • https://developers.notion.com/reference/post-database-query-filter#the-filter-object

After changing the line to search with rich_text, I was able to see the expected results for my search-by-name in the inline database.

mccorkle avatar Feb 27 '23 03:02 mccorkle