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.
Question posted in Facebook API
The official documentation for the Facebook APIs can be found here.
The official documentation for the Facebook APIs can be found here.
2
Answers
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.
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:
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:
messages
,message_deliveries
,messaging_options
emessaging_postbacks
.app.js
file with our new FBtoken
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 thehttp
module, using the Advanced JSON in Watson Conversation and create one “action”: “callApi”, and recognize with your code for do something, like this example.