配置 Facebook

介绍

Facebook集成使您的客服人员能够直接从3CX回复您的Facebook页面消息,而无需登录Facebook Messenger。消息可以传送到呼叫队列、响铃组或单个分机。坐席可以获得消息的所有权或将其转移给另一个坐席或组。

需要一个 已验证 的Facebook 企业帐户。

第 1 步:创建 Facebook 应用程序

获取用于应用程序连接的页面访问令牌

  1. 导航至 https://developers.facebook.com 并点击右上角的Log In
  2. 导航至My Apps
  3. 点击 Create App”
  4. 选择选项“Other“ 然后点击 Next
  5. 选择 Business
  6. 为您的应用程序指定一个显示名称,输入联系电子邮件,然后使用下拉列表选择您的企业帐户。点击 Create app
  7. 选择 Messenger进而 Set up
  8. 下一个页面将让您将产品添加到您的应用程序中。向下滚动到Messenger并点击Messenger API Settings
  9. 向下滚动到‘Access Tokens’部分,然后点击 Connect
  10. 点击Continue as (username) ,然后使用复选框选择您想要集成的页面。
  11. 点击Next并完成接下来的确认消息。
  12. 您现在将看到您的 Facebook 页面列在‘Access Tokens’部分中。
  13. 点击Generate token。在弹出框中,勾选 ‘I Understand’框并将令牌复制到文本中,单击 Done
  14. 最后,将Page ID(显示在页面名称下方)复制到文本。

第 2 步: 在3CX中配置

在3CX中配置Facebook

  1. 登录您的3CX网页客户端导航至管理员 > 语音和聊天并点击添加Facebook
  2. 将默认名称编辑为您喜欢的名称。
  3. 如果您是一个“系统所有者”或“系统管理员”,您可以使集成在整个系统范围内或仅在某个部门中生效。
  4. 粘贴您在第1步中获取的‘页面 ID’和‘访问令牌’。
  5. 将 3CX Webhook 复制到文本并单击Save
  6. 转到用户并创建一个临时测试用户,该用户将用于下面第4步中的应用程序审核过程。
  7. 确保消息路由已配置给您的新临时测试用户。有关这方面的更多信息,请查看 呼叫处理手册

第 3 步:配置您的 Webhook

Webhook设置: 连接并管理Messenger

  1. 导航回开发者门户的‘Meta’。
  2. 返回应用程序 > 选择并编辑您的应用程序 > Messenger API Settings > 配置 Webhooks > 单击配置。
  3. 将 3CX 生成的 Webhook 粘贴到‘Callback URL’部分。
  4. 要验证令牌,请输入随机的字母和数字字符串。不再需要此操作,因此无需保存字符串以供日后使用。点击Verify and save
  5. 点击 Add subscriptions从 ‘Generate Access Tokens’ 部分并选择以下复选框:
  • messages
  • message_deliveries
  • messaging_pre_checkouts
  • messaging_customer_information
  • message_reads
  • message_echoes
  1. 最后,点击 Save

您的应用程序现已配置为与 3CX 配合使用,您可以尝试向您的 Facebook 页面发送消息。在此阶段,您的应用程序处于‘Development’模式,这意味着您只能与有权管理您的页面的用户进行交互。要切换到‘Live’模式,您需要请求额外权限并执行应用程序审核 - 详情如下。

第 4 步:申请审核

  1. 在您的 Meta for Developers 门户中,转到App Settings > Basic。向下滚动到页面底部,然后单击+ Add platform
  2. 选择Website并点击Next
  3. 输入 3CX Web客户端的 URL(例如 https://exampledomain.com/)并单击Save changes
  4. 导航至 App Review > Permissions and Features
  5. 搜索 ‘pages_messaging’ 并点击 Request advanced access

注意:在此阶段,您可能需要在开发模式下发送或接收测试信息后等待长达24小时才能使用按钮。

  1. 现在搜索 ‘Business Asset User Profile Access’,然后再次单击Request advanced access。单击现已更改为 Edit App review request的按钮。
  2. 查看信息并向下滚动到‘Complete App Settings’。单击蓝色箭头。
  3. 为您的应用程序图标添加图像,提供隐私政策 URL 并使用下拉框将您的应用程序类别选择为 ‘Messaging’。点击 Save
  4. 单击‘Complete App Verification’ 部分中的蓝色箭头。
  5. 在弹出框中勾选No并选中“My app doesn't use the Facebook Login dialog”“Other”复选框。
  6. 将以下文本复制并粘贴到摘要框中,然后单击Save

This Facebook App is used to integrate 3CX Phone System (https://3cx.com) with Facebook Messenger chats. Each 3CX customer has their own 3CX instance and will create their own App to integrate their Facebook Page. We need “pages_messaging” to receive and reply to messages started by a Facebook Page’s visitor. “Business Asset User Profile Access” is needed because it exposes the user's name and picture for identification of chat by agents. 3CX is using the name and picture attributes.

  1. 接下来,单击下一部分中标题为 ‘How will your app use the advanced access page_messaging permission?’里的蓝色箭头。
  2. 将以下文本复制并粘贴到第一个‘detailed description’框中。

This Facebook App is used to integrate 3CX Phone System (https://3cx.com) with Facebook Messenger chats. Each 3CX customer has their own 3CX instance and therefore will need to create their own App to integrate a Facebook Page. “pages_messaging” is required to receive and send messages started by a Facebook Page visitor.

  1. Test and reproduce the functionality of your integration’下面,使用下拉框选择您的 Facebook 页面。现在,使用在第二步结束时创建的临时测试用户的凭据编辑以下文本。

Step 1. Log in to the 3CX WebClient with the following credentials:

PBX Web client URL: https://exampledomain:5001/webclient

Extension: ________

Password: ________

Step 2. Write and send a test message on the Facebook Page.

Step 3. Receive and reply to the message in your 3CX Web Client.

  1. 现在,您必须录制一个屏幕录像,展示一条消息如何发送到您的 Facebook 页面,并被web客户端接收跟回复。有许多免费的屏幕录制选项可用,包括 Loom 和 Screenrec
  2. 录制完成后,单击Upload file并选择您的截屏视频。
  3. 选中确认框并单击Save
  4. 现在,单击标题为‘How will your app use the advanced access Business asset user profile access feature?’部分中的蓝色箭头。
  5. 将以下文本复制并粘贴到详细描述框中。

This Facebook App is used to integrate 3CX Phone System (https://3cx.com) with Facebook Messenger chats. Each 3CX customer has their own 3CX instance and will create their own App to integrate their Facebook Page. 3CX needs “Business Asset User Profile Access” because it exposes the user's name and picture for identification of chat users by agents. 3CX is using the name and picture attributes.

  1. 上传您之前录制的相同截屏视频,勾选确认框并单击Save
  2. 点击 Submit for Review,输入您的 Facebook 密码进行验证,您将看到确认消息已成功提交。

App模式从Development改成Live

  1. 最后,使用屏幕顶部的切换按钮将 ‘App Mode’ 从‘Development’更改为 ‘Live’。

当您的申请获得批准后,您将收到来自 Facebook 用户的消息。您应该确保删除为应用程序验证过程创建的临时测试用户,并将消息传递路由更新到所需的目的地。

另请参阅

最后更新

本文件最后更新于2023年12月4日

https://www.3cx.cn/docs/manual/facebook/