westyside
westyside

Reputation: 116

Adaptive Card's messageBack action for msteams provided by outgoing webhook fails with "The resource URL is misformatted."

I have followed Extend Microsoft Teams Exercise - Create outgoing webhooks 3-exercise-outgoing-webhooks to build a MS Teams Outgoing webhook, and successfully it returns planet themed Adaptive Cards.

However, when I add a new messageBack action, following guidance on special Adaptive Card functionality that is specific to the Microsoft Teams channel, it fails in its reply to the webhook.

The added action I have used is copied verbatim and added to the actions list for planetDisplayCard.json:

  "actions": [
    {
      "type": "Action.OpenUrl",
      "title": "Learn more on Wikipedia"
    },
    {
      "type": "Action.Submit",
      "title": "Click me for messageBack",
      "data": {
        "msteams": {
            "type": "messageBack",
            "displayText": "I clicked this button",
            "text": "text to bots",
            "value": "{\"bfKey\": \"bfVal\", \"conflictKey\": \"from value\"}"
        }
      }
    }

The card renders in Teams, but when the button is clicked the following happen:

I have also seen this same problem with a HeroCard messageBack CardAction for my own hosted webhook service; but in trying to diagnose the problem I have reproduced with same fail with the Yeoman Generator for Microsoft Teams on my local dev environment.

A picture to illustrate my dev environment where it is all going wrong

Do messageBack Actions work with Outgoing Webhooks in MS Teams ?

Upvotes: 0

Views: 1505

Answers (1)

Hilton Giesenow
Hilton Giesenow

Reputation: 10804

I've not tested this exact scenario, but an outgoing webhook is -similar- in some ways to a bot, but not as fully featured, and can't handle multiple steps in an action like this, to my knowledge. The "Card Actions" article you've linked to basically says as much in the intro paragraph:

Cards used by bots and messaging extensions...

As a result, I'd suggest rather building a full-blown Teams bot for this scenario. You can have a look here to get started on that, and of course ask any questions here on S.overflow if you're stuck.

Upvotes: 1

Related Questions