Reputation: 116
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:
Something went wrong. Please try again.
displayText
"I clicked this button"400
code return from the POST
to https://emea.ng.msg.teams.microsoft.com/v1/agents/xxxxxx-xxxx-xxxx-xxxx-redacted/invoke
with the body {"errorCode":201,"message":"The resource URL is misformatted."}
{clientMessageId: "11862533962269802517" conversation: {id: "19:[email protected];messageid=1603494001316"} imdisplayname: "My Name" messageType: "RichText/Media_Card" name: "messageback" serverMessageId: "1603539459992" text: "text to bots" value: {bfKey: "bfVal", conflictKey: "from value"} bfKey: "bfVal" conflictKey: "from value"}
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.
Do messageBack
Actions work with Outgoing Webhooks in MS Teams ?
Upvotes: 0
Views: 1505
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