如何将Facebook与Watson对话整合 [英] How to integrate Facebook with Watson conversation

查看:81
本文介绍了如何将Facebook与Watson对话整合的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经可以将我的对话连接到我的Facebook页面,并且该机器人正在运行. 我的问题是,我找不到有关如何调用公司拥有的服务器的服务器的单个教程,该服务器具有有关帐户和付款的信息,例如,当我键入要查看的聊天机器人时,帐户列表,聊天机器人会使用该API的列表进行回复;或者,我可以通过在聊天机器人中键入帐户的名称和密码来使用我的帐户登录该服务器.我只是想知道是否有人知道该怎么做,甚至可能,或者知道一个解释它的教程.如果本教程很详细,我也希望这样做,因为我是该领域的新手.

I can already connect my conversation to my Facebook page and the bot is working. My Problem is that i couldn't find a single tutorial on how to make calls to a server that is owned by a company and has information about accounts and payments, for example when i type to the Chat-bot that i want to see a list of accounts, the chat-bot would reply with a list from that API; Or i can login to that server with my account by typing the account's name and password in the chat-bot. I just wanted to know if anyone knows how to do that or if its even possible or knows a tutorial that explains it. I also would prefer if the tutorial was detailed because i'm new to this field.

推荐答案

正如@Felipe Paixao所说,您需要开发一个编排应用程序. 我发现了一个示例,它逐步说明了如何将Watson Conversation与Facebook Messenger结合使用.

As @Felipe Paixao said, you need to develop an orchestrating application. I've found one example that explains step-by-step how to use Watson Conversation with Facebook Messenger.

要求:

  • Facebook page
  • IBM Bluemix
  • A Facebook Developer Account
  • Source code.

步骤-IBM Bluemix:

  • 为Node.js应用程序创建SDK
  • 创建Watson对话服务
  • 创建用于Watson对话的工作区并构建对话框
  • 配置JS应用并将其与Watson Service Connections -> Connect Existent :
  • Create a SDK for Node.js application
  • Create a Watson Conversation service
  • Create your Workspace for Watson Conversation and build your Dialog
  • Configure the JS app and integrate it with the Watson Service Connections -> Connect Existent:

在IBM Bluemix中创建的应用程序中,访问工具"并转到IDE Eclipse,然后创建一个新文件:app.js

In your App created in IBM Bluemix, access the Tools and go to IDE Eclipse, and create a new file: app.js with this code.

使用您的凭据替换用户名密码

您可以在服务凭据"中查看您的凭据,或进入工作区并访问:

You can see your credentials inside Service Credentials, or going to your workspace and access:

步骤-Facebook开发人员:

  • 使用您的Facebook帐户输入Facebook开发人员
  • 在信息中心中选择创建新应用,然后选择 Messenger
  • 从您的Bluemix(现在的IBM Cloud)应用程序中输入URL,然后选择标记为messagesmessage_deliveriesmessaging_options e messaging_postbacks的选项.
  • 现在,返回我们的应用以配置app.js
  • Enter to facebook developers with your Facebook account
  • In the Dashboard select Create a New App and Select Messenger
  • Put the URL from your Bluemix (Now IBM Cloud) app and select the options marked: messages, message_deliveries, messaging_options e messaging_postbacks.
  • Now, return to our app to configure the app.js file with our new FB token autogenerated and deploy it.

最终决赛

测试您的聊天机器人:如果一切正常,我们将在您的Facebook页面上提供您的聊天机器人.

Test your chatbot: If you made everything OK, we will have your chatbot available on your Facebook page.

糟糕::为构建示例,您可以使用http模块并使用Watson Conversation中的Advanced JSON在app.js中添加用于调用API的代码行一个操作":"callApi",并识别您的代码以执行某项操作,例如

Obs.: For built your example, you can add the lines of code for call your API in the app.js using the http module, using the Advanced JSON in Watson Conversation and create one "action": "callApi", and recognize with your code for do something, like this example.

  • 请参见官方参考我曾经使用基于Priscila Parodi代码的Node.js SDK(后端)源代码构建Facebook Messenger.
  • See the Official Reference that I used to build Facebook Messenger with Node.js SDK (Back-end) source code based on Priscila Parodi codes.

这篇关于如何将Facebook与Watson对话整合的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆