kjk / notionapi

Unofficial Go API for Notion.so
https://blog.kowalczyk.info/article/c9df78cbeaae4e0cb2848c9964bcfc94/using-notion-api-go-client.html
BSD 2-Clause "Simplified" License
1.82k stars 86 forks source link

BlockRecords not populated #34

Closed sonjoonho closed 3 years ago

sonjoonho commented 3 years ago

After downloading a (private) page, accessing page.BlockRecords yields an empty slice. However, page.ForEachBlock() still yields the expected result. Is this intentional, or a bug?

Minimal example:

client := &notionapi.Client{AuthToken: authToken}
page := client.DownloadPage(pageID)
// page.BlockRecords = []
sonjoonho commented 3 years ago

I see that I can get the result I want by iterating over page.Root().Content so I'm probably misunderstanding what BlockRecords actually represents, my mistake. Closing this.