Giter VIP home page Giter VIP logo

Comments (8)

adelin-b avatar adelin-b commented on May 18, 2024 3

Never mind, I found it, apparently you have to "invite" the integration after "adding" the integration, and have to do this for every page I suppose. It's super non-intuitive but it worked. I was hoping for just superuser access to the entire account. Thanks!

Maybe the error message could display this You need to share the page to the integration

from notion-sdk-js.

dheera avatar dheera commented on May 18, 2024 1

Never mind, I found it, apparently you have to "invite" the integration after "adding" the integration, and have to do this for every page I suppose. It's super non-intuitive but it worked. I was hoping for just superuser access to the entire account. Thanks!

from notion-sdk-js.

xtineskim avatar xtineskim commented on May 18, 2024

I believe you are looking for this https://developers.notion.com/reference/post-search
To list all the pages within the integration (and their respective sub pages), don't query anything!

from notion-sdk-js.

dastasoft avatar dastasoft commented on May 18, 2024

I achieve that doing:

const response = await notion.databases.query({
    database_id: process.env.NOTION_DATABASE_ID!,
  })

Is there any problem using the query?

from notion-sdk-js.

dheera avatar dheera commented on May 18, 2024

@dastasoft How do I know what the NOTION_DATABASE_ID is?
I tried using notion.databases.list() and it just returns an empty list, not even a single database.

from notion-sdk-js.

dheera avatar dheera commented on May 18, 2024

@ckim328 I tried that, it returned nothing:

(async () => {
  const response = await notion.search();
  console.log("search", response);
})();

Output:

search { object: 'list', results: [], next_cursor: null, has_more: false }

from notion-sdk-js.

dastasoft avatar dastasoft commented on May 18, 2024

@dastasoft How do I know what the NOTION_DATABASE_ID is?
I tried using notion.databases.list() and it just returns an empty list, not even a single database.

I use that same function, the other option is using notion.search because list is being deprecated. If you don't see any database maybe you're not sharing your Notion with an integration, check the initial steps and try with postman the different endpoints before diving into the JS.

from notion-sdk-js.

dheera avatar dheera commented on May 18, 2024

@dastasoft search() also returns nothing for me. How does one share with an integration? I never saw that step, and can't seem to find the answer anywhere in the docs.

from notion-sdk-js.

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.