Skip to content

HubSpot 凭据#

¥HubSpot credentials

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

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

支持的身份验证方法#

¥Supported authentication methods

  • 应用令牌与 HubSpot 节点一起使用。

¥App token: Use with the HubSpot node.

¥Developer API key: Use with the HubSpot Trigger node.

  • OAuth2:与 HubSpot 节点一起使用。

¥OAuth2: Use with the HubSpot node.

API key deprecated

HubSpot 已弃用常规 API 密钥身份验证方法。该选项仍然出现在 n8n 中,但你应该改用上面列出的身份验证方法。如果你已有使用此 API 密钥方法的集成,请参阅 HubSpot 的 将 API 密钥集成迁移到私有应用 指南并设置应用令牌。

¥HubSpot deprecated the regular API Key authentication method. The option still appears in n8n, but you should use the authentication methods listed above instead. If you have existing integrations using this API key method, refer to HubSpot's Migrate an API key integration to a private app guide and set up an app token.

相关资源#

¥Related resources

有关服务的更多信息,请参阅 HubSpot API 文档HubSpot Trigger 节点使用 Webhooks API;有关该服务的更多信息,请参阅 HubSpot Webhooks API 文档

¥Refer to HubSpot's API documentation for more information about the service. The HubSpot Trigger node uses the Webhooks API; refer to HubSpot's Webhooks API documentation for more information about that service.

使用应用令牌#

¥Using App token

要配置此凭据,你需要一个 HubSpot 账户或 HubSpot 开发者 账户以及:

¥To configure this credential, you'll need a HubSpot account or HubSpot developer account and:

  • 应用令牌

¥An App Token

要生成应用令牌,请在 HubSpot 中创建一个私有应用:

¥To generate an app token, create a private app in HubSpot:

  1. 在 HubSpot 账户中,选择主导航栏中的设置图标。

¥In your HubSpot account, select the settings icon in the main navigation bar. 2. 在左侧边栏菜单中,转到“集成”>“私有应用”。

¥In the left sidebar menu, go to Integrations > Private Apps. 3. 选择“创建私有应用”。

¥Select Create private app. 4. 在“基本信息”选项卡上,输入你的应用名称。

¥On the Basic Info tab, enter your app's Name. 5. 将鼠标悬停在占位符徽标上,然后选择上传图标,即可上传一张方形图片作为应用的徽标。

¥Hover over the placeholder logo and select the upload icon to upload a square image that will serve as the logo for your app. 6. 输入你的应用的描述。

¥Enter a Description for your app. 7. 打开“作用域”选项卡并添加相应的作用域。请参阅 HubSpot 节点的必填范围 获取应添加的完整作用域列表。

¥Open the Scopes tab and add the appropriate scopes. Refer to Required scopes for HubSpot node for a complete list of scopes you should add. 8. 选择“创建应用”以完成该过程。

¥Select Create app to finish the process. 9. 在模态框中,查看应用访问令牌的信息,然后选择“继续创建”。

¥In the modal, review the info about your app's access token, then select Continue creating. 10. 应用创建完成后,打开“访问令牌”卡片,然后选择“显示令牌”以显示令牌。

1
¥Once your app's created, open the **Access token card** and select **Show token** to reveal the token.
  1. 复制此令牌并将其输入到你的 n8n 凭据中。

    ¥Copy this token and enter it in your n8n credential.

更多信息,请参阅 HubSpot 私有应用文档

¥Refer to the HubSpot Private Apps documentation for more information.

使用开发者 API 密钥#

¥Using Developer API key

要配置此凭据,你需要一个 HubSpot 开发者 账户以及:

¥To configure this credential, you'll need a HubSpot developer account and:

  • 客户端 ID:创建公共应用后生成。

¥A Client ID: Generated once you create a public app.

  • 客户端密钥:创建公共应用后生成。

¥A Client Secret: Generated once you create a public app.

  • 开发者 API 密钥:从你的开发者应用控制面板生成。

¥A Developer API Key: Generated from your Developer Apps dashboard.

  • 应用 ID:创建公共应用后生成。

¥An App ID: Generated once you create a public app.

创建公共应用并设置凭据:

¥To create the public app and set up the credential:

  1. 登录到你的 HubSpot 应用开发者账户

¥Log into your HubSpot app developer account. 2. 从主导航栏选择“应用”。

¥Select Apps from the main navigation bar. 3. 选择“获取 HubSpot API 密钥”。你可能需要选择“显示键”选项。

¥Select Get HubSpot API key. You may need to select the option to Show key. 4. 复制密钥并将其作为开发者 API 密钥输入到你的 n8n 凭据中。

¥Copy the key and enter it in n8n as the Developer API Key. 5. 仍在 HubSpot 应用页面,选择“创建应用”。

¥Still on the HubSpot Apps page, select Create app. 6. 在“应用信息”选项卡上,添加应用名称、描述、徽标以及你希望提供的任何支持联系信息。任何访问该应用的人都会看到这些信息。

¥On the App Info tab, add an App name, Description, Logo, and any support contact info you want to provide. Anyone encountering the app would see these. 7. 打开“身份验证”选项卡。

¥Open the Auth tab. 8. 复制应用密钥并将其作为客户端密钥输入到 n8n 凭据中。

¥Copy the App ID and enter it in n8n. 9. 复制客户端 ID,并将其输入到你的 n8n 凭据中。

¥Copy the Client ID and enter it in n8n. 10. 复制客户端密钥并将其输入到 n8n 中。

1
¥Copy the **Client Secret** and enter it in n8n.
  1. 在“作用域”部分,选择“添加新的作用域”。

    ¥In the Scopes section, select Add new scope. 12. 将 HubSpot 触发器节点的必填范围 中列出的所有权限范围添加到你的应用。

    ¥Add all the scopes listed in Required scopes for HubSpot Trigger node to your app. 13. 选择“更新”。

    ¥Select Update. 14. 复制 n8n OAuth 重定向 URL,并将其作为重定向 URL 输入到你的 HubSpot 应用中。

    ¥Copy the n8n OAuth Redirect URL and enter it as the Redirect URL in your HubSpot app. 15. 选择“创建应用”以完成 HubSpot 应用的创建。

    ¥Select Create app to finish creating the HubSpot app.

请参阅 HubSpot 公共应用文档,了解更多详细说明。

¥Refer to the HubSpot Public Apps documentation for more detailed instructions.

HubSpot 触发器节点的必填范围#

¥Required scopes for HubSpot Trigger node

如果你要创建一个用于 HubSpot Trigger 节点的应用,n8n 建议你从以下范围开始:

¥If you're creating an app for use with the HubSpot Trigger node, n8n recommends starting with these scopes:

元素 对象 权限 范围名称
n/a n/a n/a oauth
CRM 公司 读取 crm.objects.companies.read
CRM 公司架构 读取 crm.schemas.companies.read
CRM 联系人 读取 crm.objects.contacts.read
CRM 联系人架构 读取 crm.schemas.contacts.read
CRM 交易 读取 crm.objects.deals.read
CRM 交易模式 读取 crm.schemas.deals.read

HubSpot old accounts

某些 HubSpot 账户没有访问所有权限范围的权限。HubSpot 正在逐步迁移账户。如果你在当前的 HubSpot 开发者账户中找不到所有权限范围,请尝试创建一个新的开发者账户。

¥Some HubSpot accounts don't have access to all the scopes. HubSpot is migrating accounts gradually. If you can't find all the scopes in your current HubSpot developer account, try creating a fresh developer account.

使用 OAuth2#

¥Using OAuth2

Note for n8n Cloud users

Cloud users don't need to provide connection details. Select Connect my account to connect through your browser.

如果你使用的是 self-hosting n8n,则需要通过创建一个新的公共应用来从头开始配置 OAuth2:

¥If you're self-hosting n8n, you'll need to configure OAuth2 from scratch by creating a new public app:

  1. 登录到你的 HubSpot 应用开发者账户

¥Log into your HubSpot app developer account. 2. 从主导航栏选择“应用”。

¥Select Apps from the main navigation bar. 3. 选择“创建应用”。

¥Select Create app. 4. 在“应用信息”选项卡上,添加应用名称、描述、徽标以及你希望提供的任何支持联系信息。任何访问该应用的人都会看到这些信息。

¥On the App Info tab, add an App name, Description, Logo, and any support contact info you want to provide. Anyone encountering the app would see these. 5. 打开“身份验证”选项卡。

¥Open the Auth tab. 6. 复制应用密钥并将其作为客户端密钥输入到 n8n 凭据中。

¥Copy the App ID and enter it in n8n. 7. 复制客户端 ID,并将其输入到你的 n8n 凭据中。

¥Copy the Client ID and enter it in n8n. 8. 复制客户端密钥并将其输入到 n8n 中。

¥Copy the Client Secret and enter it in n8n. 9. 在“作用域”部分,选择“添加新的作用域”。

¥In the Scopes section, select Add new scope. 10. 将 HubSpot 节点的必填范围 中列出的所有权限范围添加到你的应用。

1
¥Add all the scopes listed in [Required scopes for HubSpot node](#required-scopes-for-hubspot-node) to your app.
  1. 选择“更新”。

    ¥Select Update. 12. 复制 n8n OAuth 重定向 URL,并将其作为重定向 URL 输入到你的 HubSpot 应用中。

    ¥Copy the n8n OAuth Redirect URL and enter it as the Redirect URL in your HubSpot app. 13. 选择“创建应用”以完成 HubSpot 应用的创建。

    ¥Select Create app to finish creating the HubSpot app.

请参阅 HubSpot 公共应用文档,了解更多详细说明。如果你需要了解 OAuth Web 流程的更多详细信息,请参阅 HubSpot OAuth 文档

¥Refer to the HubSpot Public Apps documentation for more detailed instructions. If you need more detail on what's happening in the OAuth web flow, refer to the HubSpot Working with OAuth documentation.

HubSpot 节点的必填范围#

¥Required scopes for HubSpot node

如果你要创建一个用于 HubSpot 节点的应用,n8n 建议你从以下范围开始:

¥If you're creating an app for use with the HubSpot node, n8n recommends starting with these scopes:

元素 对象 权限 范围名称
n/a n/a n/a oauth
n/a n/a n/a forms
n/a n/a n/a tickets
CRM 公司 读取
写入
crm.objects.companies.read
crm.objects.companies.write
CRM 公司架构 读取 crm.schemas.companies.read
CRM 联系人架构 读取 crm.schemas.contacts.read
CRM 联系人 读取
写入
crm.objects.contacts.read
crm.objects.contacts.write
CRM 交易 读取
写入
crm.objects.deals.read
crm.objects.deals.write
CRM 交易模式 读取 crm.schemas.deals.read
CRM 所有者列表 读取 crm.objects.owners.read
CRM 列表 编写 crm.lists.write

HubSpot old accounts

某些 HubSpot 账户没有访问所有权限范围的权限。HubSpot 正在逐步迁移账户。如果你在当前的 HubSpot 开发者账户中找不到所有权限范围,请尝试创建一个新的开发者账户。

¥Some HubSpot accounts don't have access to all the scopes. HubSpot is migrating accounts gradually. If you can't find all the scopes in your current HubSpot developer account, try creating a fresh developer account.