glimpse2-runbook-test
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Viewing readonly version of main branch: v49View latest version
This directory contains routes for the glimpse functionality.
- Purpose: Returns Notion page data as JSON with related content (filtered for data consumption)
- Authentication: Required (Google OAuth)
- Parameters:
id
- Notion page ID - Response: Service response object with Notion page data and related content
- Filtering: Removes UI-specific properties (type: "button") for cleaner data consumption
The endpoint now fetches and includes related pages from the "Glimpse content" relation property:
- Main Page: Returns the requested page with filtered properties
- Related Content: Fetches all pages referenced in the "Glimpse content" relation
- Content Blocks: Includes full page blocks/content for each related page with nested blocks recursively fetched
- Nested Content: Supports callouts, code blocks, lists, tables, columns, and other nested block structures
- Sorting: Related pages are sorted by their "Order" property (ascending)
- Error Handling: Returns failure if main page OR any related page fails to fetch
{ "success": true, "data": { "id": "main-page-id", "properties": { ... }, // Main page properties (buttons filtered out) "glimpseContent": [ { "id": "related-page-1", "properties": { "Order": { "number": 1 }, ... }, // Related page properties (buttons filtered out) "blocks": [ ... ] // Full page content blocks with nested structures (callouts, lists, tables, etc.) }, { "id": "related-page-2", "properties": { "Order": { "number": 2 }, ... }, "blocks": [ ... ] // Full page content blocks with nested structures } ] }, "timestamp": "2025-07-27T12:00:00.000Z" }
Blocks with children will have a children
property containing their nested blocks:
{ "type": "bulleted_list_item", "bulleted_list_item": { ... }, "has_children": true, "children": [ { "type": "bulleted_list_item", "bulleted_list_item": { ... }, "has_children": false } ] }
- Main page not found: Returns
{success: false, error: "...", timestamp: "..."}
- Related page fetch fails: Returns
{success: false, error: "Failed to fetch related pages", timestamp: "..."}
- Individual block children fail: Logs warning, continues with empty children array
- No related content: Returns successful response with empty
glimpseContent
array
This is the same functionality as /views/glimpse/:id
but mounted at /glimpse/:id
for convenience.