A PowerShell module for interacting with Notion API.
- Install module from Powershell Gallery
Install-Module "PSNotion"- Before using this module, you need to obtain an API Key from Notion. You can find instructions on how to do that in the Notion API Docs. You need to finished only steps 1 and 2 from the link. To use the module, first set your Notion API Key using the following command:
New-NotionConfig -Name MyFirstAccount -APIKey secret_iGxXXXXXXXXXXXXXXXXXXXXXXXXMpZWhen you import the module, default account will be fetch from secret vault.
[PS] >> Import-Module PSNotion
WARNING: Active Notion Account - MyFirstAccount
[PS] >> Find-NotionObject -ObjectType database
object : database
id : xxxxxxxx-yyyy-zzzz-vvvv-xxxxxxxxxxxx
cover :
icon :
created_time : 30/01/2023 15:25:00
created_by : @{object=user; id=xxxxxxxx-yyyy-zzzz-vvvv-xxxxxxxxxxxx}
last_edited_by : @{object=user; id=xxxxxxxx-yyyy-zzzz-vvvv-xxxxxxxxxxxx}
last_edited_time : 06/02/2023 21:30:00
title : {@{type=text; text=; annotations=; plain_text=Test Database; href=}}
description : {}
is_inline : False
properties : @{Tags=; Name3=}
parent : @{type=page_id; page_id=xxxxxxxx-yyyy-zzzz-vvvv-xxxxxxxxxxxx}
url : https://www.notion.so/4aaxxxxxxxxxxxxxxxxxxxxxxxxxxxxxf
archived : False
...
- Find-NotionObject: Get all databases or pages shared to your integration
- Get-NotionDatabase: Retrieve a Notion database using database id.
- Get-NotionPage: Retrieve a Notion pages.
- Get-NotionPageContent: Retrieve a page blocks (page content)
- New-NotionPage: Create a new page in a Notion.
- Set-NotionBlock: Update an existing Notion block (a part of page content)
- New-NotionConfig: Add new Notion account
- Update-NotionConfig: Update a Notion account API Key
- Set-NotionActiveAccount: Switch Notion account
If you encounter any issues or have any suggestions, please open an issue in the GitHub repository.