Skip to content

Notion 凭据#

¥Notion credentials

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

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

¥Notion Trigger

先决条件#

¥Prerequisites

创建具有管理员级别访问权限的 Notion 账户。

¥Create a Notion account with admin level access.

支持的身份验证方法#

¥Supported authentication methods

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

¥API integration token: Used for internal integrations.

  • OAuth2:用于公共集成。

¥OAuth2: Used for public integrations.

Integration type

不确定要使用哪种集成类型?有关更多信息,请参阅下方的 内部集成与公共集成

¥Not sure which integration type to use? Refer to Internal vs. public integrations below for more information.

相关资源#

¥Related resources

有关服务的更多信息,请参阅 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 集成后生成。

¥An Internal Integration Secret: Generated once you create a Notion integration.

要生成集成密钥,请在 创建 Notion 集成 中操作,并从“密钥”选项卡中获取集成密钥:

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

  1. 前往你的 Notion 集成控制面板

¥Go to your Notion integration dashboard. 2. 选择“+ 新建集成”按钮。

¥Select the + New integration button. 3. 请输入集成名称,例如 n8n integration。如果需要,可以添加徽标。

¥Enter a Name for your integration, for example n8n integration. If desired, add a Logo. 4. 选择“提交”以创建集成。

¥Select Submit to create your integration. 5. 打开“功能”选项卡。选择以下功能:

¥Open the Capabilities tab. Select these capabilities:

  • Read content

  • Update content

  • Insert content

  • User information without email addresses 6. 务必保存更改。

¥Be sure to Save changes. 7. 选择“密钥”选项卡。

¥Select the Secrets tab. 8. 复制内部集成令牌并将其添加为你的 n8n 内部集成密钥。

¥Copy the Internal Integration Token and add it as your n8n Internal Integration Secret.

请参阅 内部集成授权流程设置文档,了解更多关于服务身份验证的信息。

¥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 工作区中的页面。

¥Visit the page in your Notion workspace. 2. 选择页面右上角的三个点菜单。

¥Select the triple dot menu at the top right of a page. 3. 在“连接”中,选择“连接到”。

¥In Connections, select Connect to. 4. 使用搜索栏从下拉列表中查找并选择你的集成。

¥Use the search bar to find and select your integration from the dropdown list.

与集成共享至少一个页面后,即可开始发出 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:

  • 客户端 ID:配置公共集成后生成。

¥A Client ID: Generated once you configure a public integration.

  • 客户端密钥:配置公共集成后生成。

¥A Client Secret: Generated once you configure a public integration.

你必须使用 创建 Notion 集成 并将其设置为公开分发:

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

  1. 前往你的 Notion 集成控制面板

¥Go to your Notion integration dashboard. 2. 选择“+ 新建集成”按钮。

¥Select the + New integration button. 3. 请输入集成名称,例如 n8n integration。如果需要,可以添加徽标。

¥Enter a Name for your integration, for example n8n integration. If desired, add a Logo. 4. 选择“提交”以创建集成。

¥Select Submit to create your integration. 5. 打开“功能”选项卡。选择以下功能:

¥Open the Capabilities tab. Select these capabilities:

  • Read content

  • Update content

  • Insert content

  • User information without email addresses 6. 选择“保存更改”。

¥Select Save changes. 7. 前往分发标签页。

¥Go to the Distribution tab. 8. 启用“是否要公开此集成?”控制。

¥Turn on the Do you want to make this integration public? control. 9. 请在“组织信息”部分输入你的公司名称和网站。

¥Enter your company name and website in the Organization Information section. 10. 复制 n8n OAuth 重定向 URL,并将其作为重定向 URI 添加到 Notion 集成的“OAuth 域和 URL”部分。

1
¥Copy the n8n **OAuth Redirect URL** and add it to as a **Redirect URI** in the Notion integration's **OAuth Domain & URLs** section.
  1. 前往密钥标签页。

    ¥Go to the Secrets tab. 12. 复制客户端 ID 和客户端密钥,并将其添加到你的 n8n 凭据中。

    ¥Copy the Client ID and Client Secret and add them to your n8n credential.

有关服务身份验证的更多信息,请参阅 Notion 的 公共集成身份验证流程设置 文档。

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

内部集成与公共集成#

¥Internal vs. public integrations

内部集成:

¥Internal integrations are:

  • 仅适用于单个工作区。

¥Specific to a single workspace.

  • 仅限该工作区的成员访问。

¥Accessible only to members of that workspace.

  • 非常适合自定义工作区增强功能。

¥Ideal for custom workspace enhancements.

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

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

公开集成包括:

¥Public integrations are:

  • 可在多个不相关的 Notion 工作区中使用。

¥Usable across multiple, unrelated Notion workspaces.

  • 任何 Notion 用户均可访问,无论其工作区如何。

¥Accessible by any Notion user, regardless of their workspace.

  • 非常适合满足广泛的使用场景。

¥Ideal for catering to broad use cases.

公共集成使用 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.