Skip to content

Facebook Graph API 凭据(Facebook Graph API credentials)#

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

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

Facebook 触发器凭据

如果你想为 Facebook Trigger 节点创建凭据,请按照 Facebook App 凭据 文档中提到的说明操作。

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

  • 应用访问令牌

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

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

使用应用访问令牌(Using app access token)#

要配置此凭证,你需要一个 Meta for Developers 账户以及:

🌐 To configure this credential, you'll need a Meta for Developers account and:

  • 应用 访问令牌

设置凭据分为两个步骤:

🌐 There are two steps in setting up your credential:

  1. 创建一个 Meta 应用,并添加你需要访问的产品。
  2. 为该应用生成应用访问令牌

请参阅以下各步骤的详细说明。

🌐 Refer to the detailed instructions below for each step.

创建 Meta 应用(Create a Meta app)#

要创建 Meta 应用:

🌐 To create a Meta app:

  1. 前往 Meta 开发者 应用仪表板 并选择 创建应用
  2. 如果你有商业组合并且准备将应用连接到它,请选择该商业组合。如果你没有商业组合或尚未准备好将应用连接到组合,请选择我暂时不想连接商业组合,然后选择下一步使用场景页面将打开。
  3. 选择与你希望使用 Facebook Graph API 的方式相符的用例。例如,对于 Meta 的 商业 套件中的产品(如 Messenger、Instagram、WhatsApp、营销 API、应用事件、受众网络、商务 API、筹款、招聘、威胁交换和 Webhooks),请选择其他,然后选择下一步
  4. 选择 业务 然后点击 下一步
  5. 填写必要信息:
    • 添加一个应用名称
    • 添加应用联系邮箱
    • 你可以在此处连接到业务组合,也可以跳过。
  6. 选择 创建应用
  7. 将产品添加到你的应用 页面打开。
  8. 从左侧菜单中选择 应用设置 > 基本
  9. 输入 隐私政策网址。(必须填写以使用“Live”应用。)
  10. 选择 保存更改
  11. 在页面顶部,将 应用模式开发 切换到 实时
  12. 在左侧菜单中,选择 添加产品
  13. 将产品添加到你的应用 页面将显示。请选择适合你应用的产品并进行配置。

有关创建应用、所需字段(如隐私政策 URL)以及添加产品的更多信息,请参阅 Meta 的 创建应用 文档。

🌐 Refer to Meta's Create an app documentation for more information on creating an app, required fields like the Privacy Policy URL, and adding products.

有关应用模式及切换到实时模式的更多信息,请参阅应用模式发布 | 应用类型

🌐 For more information on the app modes and switching to Live mode, refer to App Modes and Publish | App Types.

生成应用访问令牌(Generate an App Access Token)#

接下来,创建一个应用访问令牌,供你的 n8n 凭据和你选择的产品使用:

🌐 Next, create an app access token to use with your n8n credential and the products you selected:

  1. 在另一个标签页或窗口中,打开 Graph API 探索器
  2. 访问令牌 部分选择你刚创建的 Meta 应用
  3. 用户或页面中,选择获取应用令牌
  4. 选择 生成访问令牌
  5. 该页面会提示你登录并授予访问权限。请按照屏幕上的提示操作。

    应用不可用

    你可能会收到应用不可用的警告。一旦你将应用上线,可能需要几分钟的时间才能生成访问令牌。

  6. 复制令牌并将其作为 访问令牌 输入到你的 n8n 凭证中。

有关生成令牌的更多信息,请参阅你的首次请求的Meta说明。

🌐 Refer to the Meta instructions for Your First Request for more information on generating the token.