New-NotionPage

SYNOPSIS

Creates a new page in the specified database or page.

SYNTAX

Using ParentDatabaseId

New-NotionPage -Token <String> -ParentDatabaseId <String> -PageProperties <PSObject> [-PageChildren <PSObject>]
 [<CommonParameters>]

Using ParentPageId

New-NotionPage -Token <String> -ParentPageId <String> -PageProperties <PSObject> [-PageChildren <PSObject>]
 [<CommonParameters>]

DESCRIPTION

The Create-NotionPage cmdlet creates a new page and adds it to the specified database or page. The command returns the page object that was created.

EXAMPLES

Example 1

PS C:\> $PageProperties = @{
    "Name" = @{
        "title" = @(
            @{
                "text" = @{
                    "content" = "Tuscan Kale"
                }
            }
        )
    }
    "Description" = @{
        "rich_text" = @(
            @{
                "text" = @{
                    "content" = "A dark green leafy vegetable"
                }
            }
        )
    }
    "Food group" = @{
        "select" = @{
            "name" = "Vegetable"
        }
    }
    "Price" = @{ 
        "number": 2.5 
    }
}
PS C:\> $PageChildren = @{
    @(
        @{
            "object" = "block"
            "type" = "heading_2"
            "heading_2" = @{
                "text" = @(
                    { 
                        "type" = "text"
                        "text" = @{
                            "content" = "Lacinato kale" 
                        }
                    }
                )
            }
        }
        @{
            "object" = "block"
            "type" = "paragraph"
            "paragraph" = @{
                "text" = @(
                    @{
                        "type" = "text"
                        "text" = @{
                            "content" = "Lacinato kale is a variety of kale with a long tradition in Italian cuisine, especially that of Tuscany. It is also known as Tuscan kale, Italian kale, dinosaur kale, kale, flat back kale, palm tree kale, or black Tuscan palm."
                            "link" = @{
                                "url" = "https://en.wikipedia.org/wiki/Lacinato_kale"
                            }
                        }
                    }
                )
            }
        }
    )
}
PS C:\> New-NotionPage -Token "yoursupersecrettokenvalue" -ParentDatabaseId "9bd15f8d-8082-429b-82db-e6c4ea88413b" -PageProperties $PageProperties -PageChildren $PageChildren

This command adds a new page with page properties and page children to a parent database.

PARAMETERS

-PageChildren

Specifies an object containing the page children to add to the page.

Type: PSObject
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-PageProperties

Specifies an object containing the properties of the page.

Type: PSObject
Parameter Sets: (All)
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ParentDatabaseId

Specifies a string containing the ID of the parent database.

Type: String
Parameter Sets: ParentDatabaseId
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ParentPageId

Specifies a string containing the ID of the parent page.

Type: String
Parameter Sets: ParentPageId
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Token

Specifies a string containing the integration token value.

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

None

OUTPUTS

System.Object

NOTES