0

I'm programming a dialog with Watson conversation API. And now I want to insert a hyperlink inside the dialog box.

I tried these solutions here and here, but they don't work for me.

halfer
  • 19,824
  • 17
  • 99
  • 186
OiRc
  • 1,602
  • 4
  • 21
  • 60

1 Answers1

1

In the case you can do this inside Conversation flow. Add or replace the text inside JSON. Add the url with tag <a target> and href= your URL inside flows.

Check my example (EDIT with example inside conversation flow):

{
  "output": {
    "text": {
      "values": [
        "This is a link <a  target=\\\"_blank\\\" href= \\\"https://www.choosemyplate.gov\\\">Food and nutrition Guide</a>.\\n<br/><br/>Talk to you later, bye for now!"
      ],
      "selection_policy": "sequential"
    }
  }
}

See more in this link. I answered the same question with more details.

Add inside your response (not advanced response):

<a  target="_blank" href="https://google.com.br">Google</a>.\n<br/><br/>

If you have more questions about this, let me know, I'll try help you.

Community
  • 1
  • 1
Sayuri Mizuguchi
  • 5,250
  • 3
  • 26
  • 53
  • cna you insert a valid json pls? – OiRc Mar 02 '17 at 12:48
  • I inserted this, but it's not clickable, it's not a hyperlink – OiRc Mar 02 '17 at 12:54
  • Inside Service Watson conversation show all the html, but if you open the conversation, it works. Check my link with all details – Sayuri Mizuguchi Mar 02 '17 at 12:54
  • i'm using a chat in android to test it, so i want it to be used inside my chat. – OiRc Mar 02 '17 at 12:55
  • In the case isn't Watson Conversation Problem, because it works for me with various app's. Maybe is something that you must add inside your code. Check this answer [with android link](http://stackoverflow.com/questions/2734270/how-do-i-make-links-in-a-textview-clickable) – Sayuri Mizuguchi Mar 02 '17 at 12:58