-
-
Notifications
You must be signed in to change notification settings - Fork 140
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
Search does not return root page, when root is not a workpace parent level page #32
Comments
From the doc
May be you hit that? |
Hi @Blucknote, I have waited for a sufficient amount of time, also cleared all cache, and retried several times. I could get all subpages, and everything within the page, but not the root page. |
I'm tried to do a "raw" request and it seems working to me. You can see workspace parent of my page (root?). curl -X POST 'https://api.notion.com/v1/search' \
-H 'Authorization: Bearer '"$NOTION_API_KEY"'' \
-H 'Content-Type: application/json' \
-H "Notion-Version: 2021-05-13" \
--data '{
"query":"a page",
"sort":{
"direction":"ascending",
"timestamp":"last_edited_time"
}
}' {
"object": "list",
"results": [
{
"object": "page",
"id": "b092fabd-559f-44dc-b638-93050c3e50f6",
"created_time": "2021-05-20T07:15:00.000Z",
"last_edited_time": "2021-05-20T07:32:00.000Z",
"parent": {
"type": "workspace",
"workspace": true
},
"archived": false,
"properties": {
"title": {
"id": "title",
"type": "title",
"title": [
{
"type": "text",
"text": {
"content": "a page",
"link": null
},
"annotations": {
"bold": false,
"italic": false,
"strikethrough": false,
"underline": false,
"code": false,
"color": "default"
},
"plain_text": "a page",
"href": null
}
]
}
}
}
],
"next_cursor": null,
"has_more": false
}
|
Have you followed the exact steps as described in the issue? |
Not yet. Will try to duplicate. Without that search with SDK is fine |
Duplicated your page and tried with SDK. Working just fine - parent workspace. from pprint import pprint
pprint(
notion.search(query="notion-sdk-py")
) {'has_more': False,
'next_cursor': None,
'object': 'list',
'results': [{'archived': False,
'created_time': '2021-05-20T08:13:48.050Z',
'id': 'ef3910ee-e6a3-4274-b7b6-722ab00c3265',
'last_edited_time': '2021-05-20T08:16:00.000Z',
'object': 'page',
'parent': {'type': 'workspace', 'workspace': True},
'properties': {'title': {'id': 'title',
'title': [{'annotations': {'bold': False,
'code': False,
'color': 'default',
'italic': False,
'strikethrough': False,
'underline': False},
'href': None,
'plain_text': 'notion-sdk-py',
'text': {'content': 'notion-sdk-py',
'link': None},
'type': 'text'}],
'type': 'title'}}}]} |
I don't know what's wrong with my setup. I am still getting the same result, as I described in the issue. Did you try with a new integration? The integration must not have access to the parent page. Just share the "notion-sdk-py" page with the integration. |
Me neither. Just created a new integration and shared just diplicated page and still working correctly. |
By the way did you tried with another top level (workspace parent) page? I don't think there can be problem with certain page but still |
By the word "root", I did not mean workspace parent page. I meant the page that is shared with the integration. All the subpages are automatically shared with the integration. The page "notion-sdk-py" was not in workspace parent in my case. It was inside a page called "Scratch". "Scratch" had many pages, but only "notion-sdk-py" was shared with integration. I could access all the subpages of "notion-sdk-py", but not itself. Now, I share my "Home" (workspace parent level) page with the integration, and the search worked perfectly fine for "Home". I updated my original issue description. |
Now when i moved "notion-sdk-py" page into not shared one I also getting empty results now. May be we should issue Notion support with this. |
Hi @makenotion and @ramnes please look at this issue. |
I don't think highlighting an org is of much use. You'd have more luck on Notion devs Slack server. :P I don't see any reason the library would cause this. What if you try with curl or any other tool? |
@aahnik I noticed something interesting. |
I also thought that. But I am now confused. Curl and notion-sdk-py are giving different results. That is surprising. Curl is giving way more results. When I am doing a search, curl -X POST 'https://api.notion.com/v1/search' \
-H 'Authorization: Bearer '"$NOTION_API_KEY"''
-H 'Content-Type: application/json' \
-H "Notion-Version: 2021-05-13" \
--data '{
"query":"notion-sdk-py",
}' I am getting this (content within that page). Using the library, I am getting nothing. (same code and result as described in issue body). |
Closing due to the lack of activity but if anyone still has the issue, feel free to comment and I'll reopen. :) |
This is weird. I think this is a problem with Notion API and not this library. But opening this issue, so that it can be closed when this is solved.
Problem
Suppose I create a page "my page name", and add my integration to this page, then
will not give this page.
If I query for any subpage/database in this page/page within a database on this page, I will get it successfully.
Steps to reproduce
Create a new integration named "Issue32Inti".
Duplicate this page https://www.notion.so/aahnik/notion-sdk-py-540f8e2b79914654ba103c5d8a03e10e and [update]* put it inside a parent level page .share this with your integration.
Note: the page should be a subpage. Not a parent-level page. ie, it should be inside a parent page.
Now, Initialize your client object
notion
.Root page
Result ❌
Database
Result ✅
Subpage
Result ✅
[update] means that portion was later edited.
The text was updated successfully, but these errors were encountered: