0

Retrieve Block

by
Published Jun 6, 2022
Script notion Verified

The script

Submitted by hugo989 Bun
Verified 16 days ago
1
import { Client } from "@notionhq/client";
2

3
/**
4
 * Learn more at
5
 * https://developers.notion.com/reference/retrieve-a-block
6
 */
7
type Notion = {
8
  token: string;
9
};
10
export async function main(auth: Notion, block_id: string) {
11
  const client = new Client({ auth: auth.token });
12
  return await client.blocks.retrieve({ block_id });
13
}
14

Other submissions
  • Submitted by adam186 Deno
    Created 408 days ago
    1
    import { Client } from "npm:@notionhq/client";
    2
    
    
    3
    /**
    4
     * Learn more at
    5
     * https://developers.notion.com/reference/retrieve-a-block
    6
     */
    7
    type Notion = {
    8
      token: string;
    9
    };
    10
    export async function main(auth: Notion, block_id: string) {
    11
      const client = new Client({ auth: auth.token });
    12
      return await client.blocks.retrieve({ block_id });
    13
    }
    14