How to integrate Facebook with Watson conversation

旧时模样 提交于 2019-12-02 08:43:06

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.

Requirements:

Step - IBM Bluemix:

  • 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:

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.

Replace with your credentials the username and password

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

Step - Facebook Developers:

  • 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.

Step Final

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

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.

  • See the Official Reference that I used to build Facebook Messenger with Node.js SDK (Back-end) source code based on Priscila Parodi codes.

You need to develop an orchestrating application, that would be responsible to connect the IBM Watson Conversation with your desired Fronted, Facebook in this case, and the Backend systems. I imagine that you are using the automatic deploy to Facebook from the Conversation Tooling, this option would not resolve your need to access a Backend.

The image passed by @data_henrik shows exactly that.

In conversation, you can create context variables that will be used as triggers in the Orchestrator to let him know when you need to call a Backend service to provide an information and then write the response into the Conversation context.

About using the Chatbot to login into a system, passing a password, this isn't a safe option since all information typed would go to Watson Conversation log and any person with access to the tooling/api could see the passwords.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!