Skip to content

Notion 凭据(Notion credentials)#

你可以使用以下凭据验证以下节点:

🌐 You can use these credentials to authenticate the following nodes:

先决条件(Prerequisites)#

创建一个具有管理员权限的 Notion 账户。

🌐 Create a Notion account with admin level access.

支持的身份验证方法(Supported authentication methods)#

  • API 集成令牌:用于内部集成。
  • OAuth2:用于公共集成。

集成类型

不确定使用哪种集成类型?请参阅下面的内部与公共集成获取更多信息。

有关该服务的更多信息,请参阅 Notion 的 API 文档

🌐 Refer to Notion's API documentation for more information about the service.

使用 API 集成令牌(Using API integration token)#

要配置此凭据,你需要:

🌐 To configure this credential, you'll need:

  • 内部集成密钥:在创建 Notion 集成时生成。

要生成集成密钥,创建一个 Notion 集成 并从 Secrets 选项卡中获取集成密钥:

🌐 To generate an integration secret, create a Notion integration and grab the integration secret from the Secrets tab:

  1. 前往你的 Notion 集成仪表板
  2. 选择 + 新建集成 按钮。
  3. 为你的集成输入一个名称,例如 n8n integration。如有需要,可添加徽标
  4. 选择 提交 以创建你的集成。
  5. 打开 功能 标签。选择以下功能:
    • Read content
    • Update content
    • Insert content
    • User information without email addresses
  6. 请务必保存更改
  7. 选择 Secrets 选项卡。
  8. 复制 内部集成令牌 并将其添加为你的 n8n 内部集成密钥

有关如何进行服务认证的更多信息,请参阅内部集成授权流程设置文档

🌐 Refer to the Internal integration auth flow setup documentation for more information about authenticating to the service.

与集成共享 Notion 页面(Share Notion page(s) with the integration)#

为了让你的集成与 Notion 互动,你必须授予你的集成页面权限来与 Notion 工作区中的页面互动:

🌐 For your integration to interact with Notion, you must give your integration page permission to interact with page(s) in your Notion workspace:

  1. 访问 Notion 工作区中的页面。
  2. 选择页面右上角的三个点菜单。
  3. 连接 中,选择 连接到
  4. 使用搜索栏从下拉列表中查找并选择你的集成。

一旦你与集成分享了至少一个页面,你就可以开始进行 API 请求。如果页面未被分享,任何 API 请求都会返回错误。

🌐 Once you share at least one page with the integration, you can start making API requests. If the page isn't shared, any API requests made will respond with an error.

有关更多信息,请参阅集成权限

🌐 Refer to Integration permissions for more information.

使用 OAuth2(Using OAuth2)#

要配置此凭据,你需要:

🌐 To configure this credential, you'll need:

  • A 客户端 ID:在配置公共集成时生成。
  • 一个 客户端密钥:在配置公共集成后生成。

您必须创建一个 Notion 集成并将其设置为公开分发:

🌐 You must create a Notion integration and set it to public distribution:

  1. 前往你的 Notion 集成仪表板
  2. 选择 + 新建集成 按钮。
  3. 为你的集成输入一个名称,例如 n8n integration。如有需要,可添加徽标
  4. 选择 提交 以创建你的集成。
  5. 打开 功能 标签。选择以下功能:
    • Read content
    • Update content
    • Insert content
    • User information without email addresses
  6. 选择 保存更改
  7. 转到 分发 选项卡。
  8. 打开 你是否想将此集成公开? 控件。
  9. 组织信息 部分输入你的公司名称和网站。10. 复制 n8n 的 OAuth 重定向 URL 并将其作为 重定向 URI 添加到 Notion 集成的 OAuth 域名与 URL 部分。11. 转到 Secrets(密钥) 标签。12. 复制 客户端 ID客户端密钥 并将它们添加到你的 n8n 凭证中。

请参阅 Notion 的公共集成认证流程设置以获取有关如何进行服务认证的更多信息。

🌐 Refer to Notion's public integration auth flow setup for more information about authenticating to the service.

内部集成与公共集成(Internal vs. public integrations)#

内部 集成包括:

  • 仅适用于单个工作区。
  • 仅限该工作区的成员访问。
  • 非常适合自定义工作区增强功能。

内部集成使用更简单的身份验证流程(集成密钥),发布前无需任何安全审查。

🌐 Internal integrations use a simpler authentication process (the integration secret) and don't require any security review before publishing.

公开 集成包括:

  • 可在多个不相关的 Notion 工作区中使用。
  • 任何 Notion 用户均可访问,无论其工作区如何。
  • 非常适合满足广泛的使用场景。

公共集成使用 OAuth 2.0 协议进行身份验证。发布前需要进行 Notion 安全审核。

🌐 Public integrations use the OAuth 2.0 protocol for authentication. They require a Notion security review before publishing.

有关两种集成类型的更详细说明,请参阅 Notion 的内部集成与公开集成文档

🌐 For a more detailed breakdown of the two integration types, refer to Notion's Internal vs. Public Integrations documentation.