Skip to content

How to get a list of child databases within a page? #62

Answered by ramnes
wookyz asked this question in Q&A
Discussion options

You must be logged in to vote

Your cURL command looks weird. I've rewritten it myself and I get the exact same error:

$ curl -X POST "https://api.notion.com/v1/search" -H "Authorization: Bearer ${NOTION_TOKEN}" -H "Notion-Version: 2021-05-13" -H "Content-Type: application/json" --data '{"filter": {"object": "database"}}'
{"object":"error","status":400,"code":"validation_error","message":"body failed validation: body.filter.property should be defined, instead was `undefined`."}

As per Notion's documentation, here is the filter you should use:

{"property": "object", "value": "database"}

And it works, with cURL or Python:

notion.search(filter={"property": "object", "value": "database"})

I'm not sure how you ended up with…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@wookyz
Comment options

@kaedea
Comment options

@kaedea
Comment options

Answer selected by ramnes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants