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:
- Unexpected: We see
Something went wrong. Please try again.
- Expected: The chat includes the
displayText
"I clicked this button" - Unexpected: the dev tools report a
400
code return from thePOST
tohttps://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."}
- the tools show the request body
{clientMessageId: "11862533962269802517" conversation: {id: "19:xxxxxxxxxxxxxxxxxxxredacted@thread.skype;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"}
- the tools show the request body
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 ?