cstrnt / notion-api Goto Github PK
View Code? Open in Web Editor NEWUnofficial Notion.so API
Home Page: https://www.npmjs.com/package/notion-api-js
Unofficial Notion.so API
Home Page: https://www.npmjs.com/package/notion-api-js
Hi,
Thank you for building this module.
getPages() returns a list of pageIds, but getPageById, for any of them, returns:
{
errorId: '8e55a984-004f-44a3-8338-a7c68617e9e4',
name: 'ValidationError',
message: 'Invalid input.'
}
Any idea why? I need to be able to fetch Notion tables with an API.
Many thanks!
I run notion-api-js
in nodejs, but I cannot get right html content
expect html is like that
<div>music-song</div>
...
and so on
but return cotent is
[ { HTML:
'<div><h1 >Get Started</h1><p>๐ Welcome! This is a private page for you to play around with. </p><br /><p>Give these things a try:</p><br /><br /><p style="color:undefined">Have a question?</p></div>',
Attributes:
{ title: 'Get Started',
slug: 'get-started',
cover: null,
teaser:
'Get Started ๐ Welcome! This is a private page for you to play around with. Give these things a try: Have a question?',
icon: null,
id: '9bdfefb9-56af-4a3c-b21e-4301a99f6994' } },
so the return html content is total wrong? and I also use Token
, why cannot get right html content?
my code is
// require syntax
const Notion = require("notion-api-js").default;
const pageUrl = "https://www.notion.so/2628769120ad41d998ec068d6e2eb410?v=e8e69ac68a8d483792c54541e4d8ba72"
const token = "acf60ab1255a12c6c101e5beb6b776a767c25a2339ea86f0d5ac5a9abc25cbb7c1e27f439adbd9cdae1bb717f02ccf739dc694c42c86018f7b136b81ce2bbcdda4f1abd6672489231d2f3835c16c"
const notion = new Notion({
token ,
options: {
pageUrl
}
});
notion.getAllHTML().then(html => {
// Your Code here
console.log(html)
});
I just have two lines in my index.js file
import Notion from "./node_modules/notion-api-js"
console.log("Hello Notion")
and I get this error :
Failed to load module script: The server responded with a non-JavaScript MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec.
How do I resolve this?
Also, Notion's S3 config prevents being able to actually access any images.
I do the setup of putting the token and userId, then ran it but got some error.
UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'recordMap' of undefined
Turns out there's no response in fetch.js. It seems something's missing.
I used token_v2 value in F12 > Application > Storage > Cookies on Chrome.
But it says "Authentication Error: Please check your token! error". However, when I tried, getAllHTML() method seems working fine. But it gives unexpected JSON data.
Why does it show the message? What's the meaning of that?
I used the following code to run the library (of course, I used an actual token):
const Notion = require("notion-api-js");
let api = new Notion({
token: "<some token>"
});
I end up getting a TypeError upon running:
TypeError: Notion is not a constructor
Is there a max blocks per page set oder does Notion prohibit getting more?
I've made a length test with a long test on one page and it only gets data from the first 60 blocks.
Thanks!
getPages()
only returns Pages, not Subpages. The HTML for Pages that only have Subpage links is blank.
Any way to find subpageIds by pageIds?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.