How do I implement custom responses in Watson Virtual Agent?

Using the following code snippet, 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>

      

This works well, but how do I add custom responses? Let's say we want to call a RESTful endpoint (for example api.example.com/foo

) - what are the steps to do this and what should be the format of the data the endpoint should send?

How do I configure this in Watson Virtual Agent?

In the current use case, we have a working application using Watson Discovery (which works well), but we need to connect the Watson Virtual Agent to Watson Discovery.

Since we might want to run some additional code, I think a REST endpoint would be better.

What is the correct way to do this?

+3


source to share





All Articles