ramnes / notion-sdk-py

The official Notion API client library, but rewritten in Python! (sync + async)
https://ramnes.github.io/notion-sdk-py
MIT License
1.8k stars 141 forks source link

Sample query doesn't work, return empty result #187

Closed Yunlong-He closed 1 year ago

Yunlong-He commented 1 year ago

With guide in first project, I duplicated the page in my workspace, and I also created one integration, but don't know how to add the integration to that page,

In README: Lastly we need a notion page to experiment with. Duplicate this page in your workspace. Click on Share, and add your integration to this page.

I clicked Share, there are only permission settings, to everyone in this workspace, but can't find integrations there

Yunlong-He commented 1 year ago

The error shows:

Searching for the word 'People' 0 Traceback (most recent call last): File "/home/ubuntu/lab/test/notionai/test.py", line 16, in result = results[0]


IndexError: list index out of range
ramnes commented 1 year ago

Yes, it looks like the way to add an integration to a page changed.

From https://developers.notion.com/docs/authorization#integration-permissions:

To share a page with an integration, visit the page in your Notion workspace, click the ••• menu at the top right of a page, scroll down to Add connections, and use the search bar to find and select the integration from the dropdown list.

Does that help?

If so, feel free to open a PR and correct the example README!

(Note to myself ­– The issue is about this README, not the main README.)

Yunlong-He commented 1 year ago

@ramnes Thanks very much, the new way works well and the script runs ok.

I will open a PR today.

ramnes commented 1 year ago

Closed in c559bebe11507406bddcac3fbae6304801d95a6d.

Thanks again!