Open Pipe-Runner opened 2 years ago
Answering some obvious questions:
This is how I am using the auth based version of the client.
const notion = new NotionAPI({
activeUser: process.env.NOTION_ACTIVE_USER,
authToken: process.env.NOTION_TOKEN_V2
});
and yes, I have tested this with a non-public collection and it returns collections that don't have images.
Thanks for the report; definitely seems like a bug, though if I'm being honest the private auth use case is pretty low priority.
I'm not sure how helpful I can be since this is an area of notion's private API that I haven't explored much.
If you find a fix, however, we'd be happy to merge a PR.
Hi, I already made a PR fixing this issue
Hi,
I'm facing the same error on each NextJS build, without private auth involved:
[ ===] info - Generating static pages (75/193)NotionAPI getSignedfileUrls error HTTPError: Response code 400 (Bad Request)
at Request.<anonymous> (project_name/node_modules/got/dist/source/as-promise/index.js:117:42)
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
code: 'ERR_NON_2XX_3XX_RESPONSE',
timings: {
start: 1658933110956,
socket: 1658933110956,
lookup: 1658933110957,
connect: 1658933110967,
secureConnect: 1658933110978,
upload: 1658933110978,
response: 1658933111187,
end: 1658933111187,
error: undefined,
abort: undefined,
phases: {
wait: 0,
dns: 1,
tcp: 10,
tls: 11,
request: 0,
firstByte: 209,
download: 0,
total: 231
}
}
}
is there any update on this
Problem
In the earlier iteration of my website, I have used notion client but without auth, thus making my collection public. Everything worked as expected. In the latest iteration of my website, I tried out the auth based approach. But it seems that some collections are fetched all right, but some of them return this error:
Exploration from my end
I have experimented a bit and it seems like in whichever blogs, I have uploaded an image, this error shows up. Only when I make the collection public, it returns the response correctly. This is not the case for other collections which do not have an image. There they work without making them public.