Skip to content
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

databases.list not returning any databases. #56

Closed
julianbenegas opened this issue May 14, 2021 · 6 comments
Closed

databases.list not returning any databases. #56

julianbenegas opened this issue May 14, 2021 · 6 comments

Comments

@julianbenegas
Copy link

julianbenegas commented May 14, 2021

notion.databases.list is returning no results. Code is something like:

import { NextApiRequest, NextApiResponse } from "next"
import { notion } from "../../lib/notion"

export default async (req: NextApiRequest, res: NextApiResponse) => {
  console.log(await notion.users.list({})) // This one is returning all our users, so the integration works.
  console.log(await notion.databases.list({})) //  This one is returning { ..., results: [] }, an empty array.

 // btw, to both methods I have to pass an empty object else typescript will complain, which is odd.

  res.status(200).send("ok")
}

We have lots of databases on our workspace, and a couple of them are even public to the whole web.

@ramnes
Copy link
Contributor

ramnes commented May 14, 2021

You need to share with the integration user. :)

@julianbenegas
Copy link
Author

yeah, sorry, read it just now 🙈

@iltimasd
Copy link

I'm also having this problem even though integration has a page with inline table and a table page shared with it.

Screen Shot 2021-05-20 at 1 48 41 PM

and I'm running the supplied example SDK code from the reference:

const { Client } = require('@notionhq/client');

const notion = new Client({ auth: process.env.NOTION_API_KEY });

(async () => {
  const response = await notion.databases.list();
  console.log(response);
})();

which returns

> node index.js

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

@luigimoyano
Copy link

I have exactly the same problem... I have shared the database with the integration but it does get nothing

@terwer
Copy link

terwer commented Aug 4, 2023

+1.I have exactly the same problem... I have shared the database with the integration but it does get nothing

@terwer
Copy link

terwer commented Aug 4, 2023

I use the search api.also return empty results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants