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
javascript node.js watson watson-discovery


source to share


No one has answered this question yet

Check out similar questions:

5129
How do I return a response from an asynchronous call?
671
How do I implement a stack and queue in JavaScript?
2
How do I integrate Watson Discovery with Watson Virtual Agent?
1
Changing the background color of my Watson virtual agent
1
Watson Virtual Agent vs. IBM Watson Conversation
1
Watson Virtual Agent - added javascript to the page, now what?
0
Changing watson virtual agent capabilities
0
Failed to create new key for watson virtual agent
0
Watson virtual agent preview: how to reset it?
0
Embeded Watson Virtual Agent chatbot missing response



All Articles
Loading...
X
Show
Funny
Dev
Pics