-
Notifications
You must be signed in to change notification settings - Fork 481
Is it possible to create a new row from a page template in a database? #194
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
Comments
I wrote a copy function for issue #125, does this solution suit your needs? |
Hey, your solution works, except that it'd would be slow for long templates (since copy-pasting each element takes some considerable time) and for styling related issues (Text/Block elements reverting to default colors and font styles). I was hoping to figure a way to import a page template directly into my page, just like what the New>Template button in a DB would do. |
Did you ever come up with a solution or workaround? I have a similar use case. |
Sadly, New > Template is handled by the JavaScript on the page, not by the back-end (same for duplicating blocks). The only POST-request that is send to the server are the properties of the new page/block. |
Dang, that is unfortunate. Thanks for the heads up |
It looks as if "Duplicate", in any case, happens on the server side. If anyone wants to give this a shot, check out calls to the following API endpoints:
The API looks fairly straightforward; the main complication is that it's async, so you either need to make the method (e.g. |
I looked into this a bit and wasn't able to get it running mainly because V3 doesn't take Bearer for authorization like V1 does. Any idea what it does take? token_v2 or something for v3? I will inspect its communications. I'm writing it in curl btw so far I'm able to use append blocks API that they posted for their official API but since a page is not seen as a block (it is returned as type:unsupported because it only sees things like toggle as a block) I wasn't able to append a page inside a template(page/row) to a newly created page/row. |
I would like to automate an action where a row/page is created everyday. The contents of the page should be retreived from a template stored in the db. Wrote a makeshift solution using copy but it's too slow and inefficient for what I'm looking for.
Is there a script or function in notion.py that can let me create a page using a template?
Thanks.
The text was updated successfully, but these errors were encountered: