Code Monkey home page Code Monkey logo

Comments (16)

Blucknote avatar Blucknote commented on May 26, 2024 2

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 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.

from notion-sdk-py.

Blucknote avatar Blucknote commented on May 26, 2024

From the doc

🚧 Search indexing is not immediate
If an integration performs a search quickly after a page is shared with the integration (such as immediately after a user performs OAuth), the response may not contain the page.
When an integration needs to present a user interface that depends on search results, we recommend including a Refresh button to retry the search. This will allow users to determine if the expected result is present or not, and give them a means to try again.

May be you hit that?

from notion-sdk-py.

aahnik avatar aahnik commented on May 26, 2024

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.

from notion-sdk-py.

Blucknote avatar Blucknote commented on May 26, 2024

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?).
May be I'll try later with SDK

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
}

from notion-sdk-py.

aahnik avatar aahnik commented on May 26, 2024

I'm tried to do a "raw" request and it seems working to me.

Have you followed the exact steps as described in the issue?

from notion-sdk-py.

Blucknote avatar Blucknote commented on May 26, 2024

Have you followed the exact steps as described in the issue?

Not yet. Will try to duplicate. Without that search with SDK is fine

from notion-sdk-py.

Blucknote avatar Blucknote commented on May 26, 2024

Have you followed the exact steps as described in the issue?

Duplicated your page and tried with SDK. Working just fine - parent workspace.
My integration name differs but I'm pretty sure it's not a problem.

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'}}}]}

from notion-sdk-py.

aahnik avatar aahnik commented on May 26, 2024

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.

from notion-sdk-py.

Blucknote avatar Blucknote commented on May 26, 2024

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.
Also i noticed there is no way to delete integrations

image

image

from notion-sdk-py.

Blucknote avatar Blucknote commented on May 26, 2024

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

from notion-sdk-py.

aahnik avatar aahnik commented on May 26, 2024

another top-level (workspace parent) page

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.

from notion-sdk-py.

aahnik avatar aahnik commented on May 26, 2024

Hi @makenotion and @ramnes please look at this issue.

from notion-sdk-py.

ramnes avatar ramnes commented on May 26, 2024

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?

from notion-sdk-py.

Blucknote avatar Blucknote commented on May 26, 2024

@aahnik I noticed something interesting.
Move page shared with integration into page which does not.
On this step nothing suspecious. But
When you move page on workspace level it does not shared with integration anymore

from notion-sdk-py.

aahnik avatar aahnik commented on May 26, 2024

I don't see any reason the library would cause this.

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).

from notion-sdk-py.

ramnes avatar ramnes commented on May 26, 2024

Closing due to the lack of activity but if anyone still has the issue, feel free to comment and I'll reopen. :)

from notion-sdk-py.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.