Using the following piece of code we can create the Watson Virtual Again widget:
<script src='https://dp1-bot-chat.mybluemix.net/IBMChatClient-v1.1.0.js'></script>
<script>
IBMChat.init({
el: 'ibm_chat_root',
baseURL: 'https://api.ibm.com/virtualagent/run/api/v1',
botID: '___mybotid___',
XIBMClientID: '__myclientid____',
XIBMClientSecret: '___mysecret____'
});
</script>
That works nicely, but how can we add custom responses? Let's say that we want to call a RESTful endpoint (e.g. api.example.com/foo
)—what are the steps to do that and what should be the data format the endpoint should send?
How to configure this in the Watson Virtual Agent?
The current use-case is that we have a running app using Watson Discovery (which works well), but we need to connect the Watson Virtual Agent to the Watson Discovery.
Because we may want to run some additional code I guess a REST endpoint would be better.
What is the right way to do it?