notion.notion.retrieveblockchildren
Home > @runlightyear/notion > Notion > retrieveBlockChildren
Notion.retrieveBlockChildren() method
Retrieve block children
Signature:retrieveBlockChildren(props: RetrieveBlockChildrenProps): Promise<RetrieveBlockChildrenResponse>;
Parameters
Parameter | Type | Description |
---|---|---|
props | RetrieveBlockChildrenProps |
Promise<RetrieveBlockChildrenResponse>
Example
Retrieve a block's children
import { defineAction } from "@runlightyear/lightyear";
import { Notion } from "@runlightyear/notion";
defineAction({
name: "retrieveBlockChildren",
title: "Retrieve Block Children",
apps: ["notion"],
variables: ["blockId"],
run: async ({ auths, variables }) => {
const notion = new Notion({
auth: auths.notion,
});
const response = await notion.retrieveBlockChildren({
blockId: variables.blockId!,
});
console.log("Block children:", response.data);
},
});