react-notion-x icon indicating copy to clipboard operation
react-notion-x copied to clipboard

Search returns no result

Open sagan opened this issue 1 year ago • 0 comments
trafficstars

Description

It seems that Notion search API now requires a "includePublicPagesWithoutExplicitAccess": true field present in filter object of search request payload. Without that field, search will return an empty result set.

Notion Test Page ID

1197d259b2558072b6e7d0be8e03a215

Without the field:

curl 'https://www.notion.so/api/v3/search' \
  -H 'content-type: application/json' \
  --data '{"type":"BlocksInAncestor","query":"test","ancestorId":"1197d259-b255-8072-b6e7-d0be8e03a215","filters":{"isDeletedOnly":false,"excludeTemplates":false,"navigableBlockContentOnly":false,"requireEditPermissions":false,"ancestors":[],"createdBy":[],"editedBy":[],"lastEditedTime":{},"createdTime":{},"inTeams":[] },"sort":{"field":"relevance"},"limit":20,"source":"quick_find_input_change"}'

The returned results is empty.

With the field:

curl 'https://www.notion.so/api/v3/search' \
  -H 'content-type: application/json' \
  --data '{"type":"BlocksInAncestor","query":"test","ancestorId":"1197d259-b255-8072-b6e7-d0be8e03a215","filters":{"isDeletedOnly":false,"excludeTemplates":false,"navigableBlockContentOnly":false,"requireEditPermissions":false,"includePublicPagesWithoutExplicitAccess":true,"ancestors":[],"createdBy":[],"editedBy":[],"lastEditedTime":{},"createdTime":{},"inTeams":[] },"sort":{"field":"relevance"},"limit":20,"source":"quick_find_input_change"}'

sagan avatar Nov 12 '24 07:11 sagan