Forum Discussion
Unable to send an image attachment to the incoming webhook in Teams
- Dec 14, 2023
ameenv - To send an image to a Teams channel using an incoming webhook, you can include the image as an attachment in the Adaptive Card payload.
{ "type": "message", "attachments": [ { "contentType": "application/vnd.microsoft.card.adaptive", "content": { "type": "AdaptiveCard", "body": [ { "type": "ActionSet", "actions": [ { "type": "Action.OpenUrl", "title": "View in Datafi", "style": "default", "role": "Link", "url": "https://abc.us", "tooltip": "View in abc" } ] }, { "type": "Image", "url": "data:image/jpeg;base64,/xxxxxxxx" } ], "$schema": "http://adaptivecards.io/schemas/adaptive-card.json", "version": "1.0" } } ] }
In this example, the image is included as an attachment of type "Image" with the URL set to the base64 encoded image data. Make sure to replace
/xxxxxxxx
with the actual base64 encoded image data.Thanks,
Prasad Das
------------------------------------------------------------------------------------------
If the response is helpful, please click "**Mark as Best Response**" and like it. You can share your feedback via Microsoft Teams Developer Feedback link. Click here to escalate.
ameenv - To send an image to a Teams channel using an incoming webhook, you can include the image as an attachment in the Adaptive Card payload.
{
"type": "message",
"attachments": [
{
"contentType": "application/vnd.microsoft.card.adaptive",
"content": {
"type": "AdaptiveCard",
"body": [
{
"type": "ActionSet",
"actions": [
{
"type": "Action.OpenUrl",
"title": "View in Datafi",
"style": "default",
"role": "Link",
"url": "https://abc.us",
"tooltip": "View in abc"
}
]
},
{
"type": "Image",
"url": "data:image/jpeg;base64,/xxxxxxxx"
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.0"
}
}
]
}
In this example, the image is included as an attachment of type "Image" with the URL set to the base64 encoded image data. Make sure to replace /xxxxxxxx
with the actual base64 encoded image data.
Thanks,
Prasad Das
------------------------------------------------------------------------------------------
If the response is helpful, please click "**Mark as Best Response**" and like it. You can share your feedback via Microsoft Teams Developer Feedback link. Click here to escalate.
- ameenvDec 14, 2023Copper ContributorThanks Prasad_Das-MSFT, It works!
- Prasad_Das-MSFTDec 14, 2023
Microsoft
ameenv - Glad that it worked. Could you please share your valuable feedback via Microsoft Teams Developer Community Response Feedback link?