0

I need to automatically redirect the user to an URL after they answer a survey with Watson assistant. What would be the easiest way to do it?

I use this code in IBM function but I got a 400 error:

var http = require("http");

http.createServer(function(req, res) {
  res.writeHead(301,{Location: 'http://venomcb.ca'});
  res.end();
}).listen(8888);

Thanks for your help.

user6610
  • 23
  • 3
  • So you don't have an orchestration layer? How are you surfacing your Assistant Skill - a Web Widget? Facebook Messenger? – chughts Jul 24 '19 at 17:27
  • I use a Web Widget with WordPress. – user6610 Jul 24 '19 at 17:29
  • Your dialog needs to signal to the WordPress Widget / Plugin to initiate a page redirect. How I don't know, and there doesn't appear to be any documentation on how. I am not sure if the developers of the Widget will read this, but they do have a support forum - https://wordpress.org/support/plugin/conversation-watson/ where you can ask the question as to how to initiate a page redirect. – chughts Jul 25 '19 at 09:30

1 Answers1

0

I found out that you can add custom JavaScript to the widget. U can then read the responses and react based on them. Read the short Q&A here with a simple example and references.

https://wordpress.org/support/topic/can-we-add-custom-html-js-in-a-message-using-wordpress-plugin/

Dave
  • 15
  • 1
  • 7