Facebook Graph API 凭据#
¥Facebook Graph API credentials
你可以使用以下凭据验证以下节点:
¥You can use these credentials to authenticate the following nodes:
Facebook Trigger credentials
如果你想为 Facebook 触发器 节点创建凭据,请按照 Facebook 应用凭据 文档中的说明进行操作。
¥If you want to create credentials for the Facebook Trigger node, follow the instructions mentioned in the Facebook App credentials documentation.
支持的身份验证方法#
¥Supported authentication methods
- 应用访问令牌
¥App access token
相关资源#
¥Related resources
有关服务的更多信息,请参阅 Meta 的 Graph API 文档。
¥Refer to Meta's Graph API documentation for more information about the service.
使用应用访问令牌#
¥Using app access token
要配置此凭据,你需要一个 面向开发者的 Meta 账户以及:
¥To configure this credential, you'll need a Meta for Developers account and:
- 应用访问令牌
¥An app Access Token
设置凭据分为两个步骤:
¥There are two steps in setting up your credential:
- 创建 Meta 应用 使用你需要访问的产品。
¥Create a Meta app with the products you need to access. 2. 生成应用访问令牌 用于该应用。
¥Generate an App Access Token for that app.
请参阅以下各步骤的详细说明。
¥Refer to the detailed instructions below for each step.
创建 Meta 应用#
¥Create a Meta app
要创建 Meta 应用:
¥To create a Meta app:
- 前往 Meta Developer 应用仪表盘,选择“创建应用”。
¥Go to the Meta Developer App Dashboard and select Create App. 2. 如果你有企业作品集,并且准备将应用连接到它,请选择企业作品集。如果你没有业务组合或尚未准备好将应用连接到业务组合,请选择“我暂时不想连接业务组合”,然后选择“下一步”。“用例”页面打开。
¥If you have a business portfolio and you're ready to connect the app to it, select the business portfolio. If you don't have a business portfolio or you're not ready to connect the app to the portfolio, select I don’t want to connect a business portfolio yet and select Next. The Use cases page opens. 3. 选择与你希望如何使用 Facebook Graph API 相符的用例。例如,对于 Meta 商业套件中的产品(例如 Messenger、Instagram、WhatsApp、Marketing API、App Events、Audience Network、Commerce API、Fundraisers、Jobs、Threat Exchange 和 Webhooks),请选择“其他”,然后选择“下一步”。
¥Select the Use case that aligns with how you wish to use the Facebook Graph API. For example, for products in Meta's Business suite (like Messenger, Instagram, WhatsApp, Marketing API, App Events, Audience Network, Commerce API, Fundraisers, Jobs, Threat Exchange, and Webhooks), select Other, then select Next. 4. 选择“业务”和“下一步”。
¥Select Business and Next. 5. 填写必要信息:
¥Complete the essential information:
-
添加应用名称
¥Add an App name.
-
添加一个应用联系人邮箱。
¥Add an App contact email.
-
你可以在此处连接到业务组合,也可以跳过。
¥Here again you can connect to a business portfolio or skip it. 6. 选择“创建应用”。
¥Select Create app. 7. “将产品添加到你的应用”页面打开。
¥The Add products to your app page opens. 8. 从左侧菜单中选择“应用设置”>“基本”。
¥Select App settings > Basic from the left menu. 9. 请输入隐私政策 URL。(安装应用 "直播中。" 的必要条件)
¥Enter a Privacy Policy URL. (Required to take the app "Live.") 10. 选择“保存更改”。
1 | |
-
在页面顶部,将应用模式从“开发”切换到“正式”。
¥At the top of the page, toggle the App Mode from Development to Live. 12. 在左侧菜单中,选择“添加产品”。
¥In the left menu, select Add Product. 13. “将产品添加到你的应用”页面出现。选择适合你应用的产品并进行配置。
¥The Add products to your app page appears. Select the products that make sense for your app and configure them.
有关创建应用、必填字段(例如隐私政策 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:
- 在单独的标签页或窗口中打开 Graph API Explorer。
¥In a separate tab or window, open the Graph API explorer.
- 选择你刚刚在“访问令牌”部分创建的元应用。
¥Select the Meta App you just created in the Access Token section.
- 在“用户或页面”中,选择“获取应用令牌”。
¥In User or Page, select Get App Token.
- 选择“生成访问令牌”。
¥Select Generate Access Token.
- 页面提示你登录并授予访问权限。按照屏幕提示操作。
¥The page prompts you to log in and grant access. Follow the on-screen prompts.
App unavailable
1 | |
- 复制令牌并将其作为访问令牌输入到你的 n8n 凭据中。
¥Copy the token and enter it in your n8n credential as the Access Token.
请参阅 你的首次请求 文档的 Meta 说明,了解有关生成令牌的更多信息。
¥Refer to the Meta instructions for Your First Request for more information on generating the token.