0

I have integrated Watson Assistant with Slack App using Slack Integration.

Now, I am trying to push Native JSON supported by Slack through Watson Dialog using JSON Editor.

I found an article which says I need to use -

output.slack: insert any JSON you want to be included in the attachment field of the Slack.

So, I tried using the following as response,

{
  "output": {
    "slack": {
      "text": "Choose an action"
    }
  }
}

AND

{
  "output": {
    "slack": {
      "attachments":[
        {
          "text": "Choose an action"
        }
        ]
    }
  }
}

ALSO tried several combinations by adding "title" referencing this document

{
  "output": {
    "slack": [{
      "title" : "Test Title",
      "text" :[
      {
        "value": "Hello"
      }
        ]
    }]
  }
}

AND

{
  "output": {
    "slack": {
      "title" : "Test Title",
      "text" : "Hello"
      }
  }
}

AND

{
  "output": {
    "slack": {
      "attachments": 
        {
          "title" : "Test Title",
          "text" : "Hello"
        }

      }
  }
}

But Slack does not detect it and doesn't show anything.

I've already enabled Interactivity for my app on Slack.

Has anyone been able to pass Native JSON to slack via Watson Dialog? What am I doing wrong here?

Techidiot
  • 1,921
  • 1
  • 15
  • 28
  • Based on the Watson Assistant docs, Slack messages require a title: https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-overview#dialog-overview-multimedia Have you tried not just sending "text"? – data_henrik May 06 '20 at 09:27
  • @data_henrik You mean in addition to "text", we need to pass "title" too? I just tried it and several combinations but can't get it to work. – Techidiot May 06 '20 at 09:49
  • @data_henrik Updated a few attempts in the question. – Techidiot May 06 '20 at 10:05

1 Answers1

0

you should update your webhook to a version after April 2020. then do

{
  "output": {
    "integrations": {
      "slack": [{
        "title" : "Test Title",
        "text" :[
        {
          "value": "Hello"
         }
       ]
    }]
  }
}
}

note the integrations

Dudi
  • 2,340
  • 1
  • 24
  • 39