I am using Watson Conversation Service based on a sample app with NodeJS server and HTML client implementation. I have a separate event trigger app that communicates with NodeJS. Given a particular event trigger, I would like to display Watson's output text in HTML client side. Since it won't have any HTML request, I was wondering how I could display or make a conversation.message api.
2 Answers
Forgive me if I misunderstand your request. But most of the IBM demo's based on Nodejs and the Watson conversation service demonstrate how to take the output.text json element, and either wrap it in html and pass back to the client, or show how the client can wrap the packet in html. I would recommend using one of these demos as an example.
https://github.com/IBM/watson-online-store/?cm_sp=Developer--https://developer.ibm.com/code/journey/create-cognitive-retail-chatbot/--Get-the-Code
and this will be helpful.
https://www.ibm.com/blogs/watson/2016/10/app-developers-guide-creating-first-watson-bot/
In this case you can use the return from the http request and create some custom code to render in your client side when user typed and send the message. Try to use express and body-parser, for do what @timd said.
But, I think the code from IBM Professionals inside watson-developer-cloud, in this case, conversation-simple project. This is one example with nodejs and Watson Conversation Service. You can use the code or you can build your custom code based on this example.
Try too see methods and the Official Documentantion API Reference here.