watson-conversationbotkitwatson-dialog

Watson Conversation and Facebook Messenger Rich-Text


How to use facebook message templates to offer a rich-text as integrating buttons, images, lists and other facebook messenger features in Watson. I'm following Facebook Messenger Developer but I don't know where should I insert the appropriate code? In the JSON editor of watson conversation or in the bot-facebook.js of botkit?

I tried this in the JSON editor of watson conversation but it does not work:

Screenshot of the JSON editor


Solution

  • You will need an orchestration layer to handle the encoding to the desired platform format, you then create an action within the middleware to handle this response. e.g FB messenger requires an object to be passed such as

    "buttons":[
      {
        "type":"web_url",
        "url":"https://petersfancyapparel.com/criteria_selector",
        "title":"Select Criteria",
        "webview_height_ratio": "full",
        "messenger_extensions": true,  
        "fallback_url": "https://petersfancyapparel.com/fallback"
      }
    ]
    

    An example orchestration layer such as Botkit, or a better alternative Botmaster can be used alongside its extension fulfill that will allow you to create these objects and in the Watson dialog simply just add custom XML tags. E.g www.google.com this will then be passed to the orchestration layer which will send the relevant object. A code example using this method can be found here with some other Facebook actions.