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?

4

1 回答 1

0

您应该将您的 webhook 更新到 2020 年 4 月之后的版本。然后执行

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

注意integrations

于 2020-12-01T09:16:08.820 回答