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

How to get children blocks ? #16

Closed
j-barot opened this issue May 27, 2023 · 4 comments
Closed

How to get children blocks ? #16

j-barot opened this issue May 27, 2023 · 4 comments
Assignees
Labels
enhancement New feature or request question Further information is requested
Milestone

Comments

@j-barot
Copy link

j-barot commented May 27, 2023

Hi, i'm looking to get children blocks of a specific page, i can see i should be able to do it but i don't find a way ^^' Thanks !

@minwook-shin minwook-shin self-assigned this May 28, 2023
@minwook-shin minwook-shin added the question Further information is requested label May 28, 2023
@minwook-shin
Copy link
Owner

hello, @j-barot it doesn't.
notion official documentation also you to use the block API instead of page.
this package does not support the block API. (But, can create children block!)

ref : https://developers.notion.com/reference/retrieve-a-page

Retrieves a Page object using the ID specified.

Responses contains page properties, not page content. To fetch page content, use the Retrieve block children endpoint.

I will let you know when finished developing feature.

@minwook-shin minwook-shin added the enhancement New feature or request label May 30, 2023
@minwook-shin minwook-shin added this to the 1.1.0 milestone May 30, 2023
@minwook-shin
Copy link
Owner

B = Block(integrations_token=NOTION_KEY)
for j in D.result["results"]:
    B.retrieve_block(block_id=j["id"], is_children=True)
    pprint.pprint(B.result)

coming soon, (on 1.1.0 milestone ) :)

@minwook-shin
Copy link
Owner

minwook-shin commented May 30, 2023

@j-barot released version 1.1.0, which add this feature.
https://github.com/minwook-shin/notion-database/releases/tag/1.1.0

pip install notion-database==1.1.0

Here an example.
https://github.com/minwook-shin/notion-database/blob/main/page_content_example.py

@j-barot
Copy link
Author

j-barot commented May 30, 2023

Wow thanks ! I'll update and using it asap !

@j-barot j-barot closed this as completed May 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants