Custom bot outgoing webhook: attachment not included in json payload

Rick Hui 21 Reputation points
2020-12-02T20:29:33.76+00:00

Hi all,

I am trying to build a custom bot that can communicate with MS Teams, I have set up the outgoing webhook (https://learn.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/how-to/add-outgoing-webhook), and I am able to receive message payload from MS Teams, but I cannot receive attachments inside the JSON payload.

Is there any solution to this problem?

Below is the JSON payload when I try to attach an image to my bot.
{
"type": "message",
"id": "1606936241728",
"timestamp": "2020-12-02T19:10:41.9435348Z",
"localTimestamp": "2020-12-02T11:10:41.9435348-08:00",
"serviceUrl": "https://smba.trafficmanager.net/ca/",
"channelId": "msteams",
"from": {
"id": "29:1ENKqjXmBSpF-3kVwhOWJ2_aNYm0zEFVNcxNeODuwjtBPceWF09tgw2SLvOX67kAxwStlyBze2KPi3CnIdUI1VA",
"name": "ricky",
"aadObjectId": "22cbed5c-dcf1-4ef6-97a0-025ae9386646"
},
"conversation": {
"isGroup": true,
"id": "19:a1a19bb65aec4eacbfffba282299960d@thread.tacv2;messageid=1606936241728",
"name": null,
"conversationType": "channel",
"tenantId": "7e3430fa-a095-4678-bfb9-f3de3aa27b7c"
},
"recipient": null,
"textFormat": "plain",
"attachmentLayout": null,
"membersAdded": [],
"membersRemoved": [],
"topicName": null,
"historyDisclosed": null,
"locale": "en-US",
"text": "<at>bot</at>\n",
"speak": null,
"inputHint": null,
"summary": null,
"suggestedActions": null,
"attachments": [
{
"contentType": "text/html",
"contentUrl": null,
"content": "<div><div><span itemscope=\"\" itemtype=\"http://schema.skype.com/Mention\" itemid=\"0\">bot</span></div>\n</div>",
"name": null,
"thumbnailUrl": null
}
],
"entities": [
{
"type": "clientInfo",
"locale": "en-US",
"country": "US",
"platform": "Mac"
}
],
"channelData": {
"teamsChannelId": "19:a1a19bb65aec4eacbfffba282299960d@thread.tacv2",
"teamsTeamId": "19:a1a19bb65aec4eacbfffba282299960d@thread.tacv2",
"channel": {
"id": "19:a1a19bb65aec4eacbfffba282299960d@thread.tacv2"
},
"team": {
"id": "19:a1a19bb65aec4eacbfffba282299960d@thread.tacv2"
},
"tenant": {
"id": "7e3430fa-a095-4678-bfb9-f3de3aa27b7c"
}
},
"action": null,
"replyToId": null,
"value": null,
"name": null,
"relatesTo": null,
"code": null
}

And below is the message I sent via. MS Teams App
44449-screen-shot-2020-12-02-at-111026-am.png

Azure AI Bot Service
Azure AI Bot Service
An Azure service that provides an integrated environment for bot development.
742 questions
Microsoft Teams Development
Microsoft Teams Development
Microsoft Teams: A Microsoft customizable chat-based workspace.Development: The process of researching, productizing, and refining new or existing technologies.
2,815 questions
{count} votes

0 additional answers

Sort by: Most helpful