External API integrations (pure API calls only).
Services are the data access layer that:
All service functions return:
{
success: boolean,
data?: any, // Present on success
error?: string, // Present on failure
timestamp: string // ISO timestamp of the operation
}
string
, number
, boolean
only{
success: true,
data: {
results: NotionDatabase[],
next_cursor: string | null,
has_more: boolean
},
timestamp: string
}
{
success: true,
data: {
id: string,
title: RichText[],
properties: { [key: string]: PropertySchema },
// ... full Notion database object
},
timestamp: string
}
{
success: true,
data: {
results: NotionPage[],
next_cursor: string | null,
has_more: boolean
},
timestamp: string
}
{
success: true,
data: {
id: string,
properties: { [key: string]: PropertyValue },
parent: { database_id: string } | { page_id: string },
// ... full Notion page object
},
timestamp: string
}
{
success: true,
data: {
results: NotionBlock[] // Each block may have .children array
},
timestamp: string
}
{
success: true,
data: {
// All page properties
id: string,
properties: { [key: string]: PropertyValue },
// Plus blocks array
blocks: NotionBlock[]
},
timestamp: string
}
getPageById
response{
success: true,
data: {
results: NotionPage[], // Pages with Email property matching
next_cursor: string | null,
has_more: boolean
},
timestamp: string
}
getPageById
responseServices return detailed error information:
{
success: false,
error: "Notion API error message", // Direct from external API
timestamp: string
}
Common error scenarios: