Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I'm using the MS Graph API Explorer to send messages to Channels in Teams, but whenever I send a message with an Adaptive Card attached, it adds padding to the top of the card and a 3-dot menu on the right with a "Copy" option.

The examples in Microsoft's documentation do not seem to have this problem.

Image of Card in Teams with extra padding at top

Is there a way to remove this padding and menu? or can I alter the content shown in this space?

I'm using the following endpoint... https://graph.microsoft.com/v1.0/teams/{team-id}/channels/{channel-id}/messages

With the following request body...

{
  "body": {
    "contentType": "html",
    "content": "<attachment id="4465B062-EE1C-4E0F-B944-3B7AF61EAF40"></attachment>"
  },
  "attachments": [
    {
      "id": "4465B062-EE1C-4E0F-B944-3B7AF61EAF40",
      "contentType": "application/vnd.microsoft.card.adaptive",
      "content": "{
        "type": "AdaptiveCard",
        "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
        "version": "1.3",
        "body": [
          {
            "type": "TextBlock",
            "size": "Large",
            "weight": "Bolder",
            "text": "My News Item",
            "wrap": true
          }
        ],
        "actions": [
          {
            "type": "Action.OpenUrl",
            "title": "View",
            "url": "https://bing.com"
          }
        ]
      }"
    }
  ]
}
question from:https://stackoverflow.com/questions/65936168/using-ms-graph-explorer-to-send-a-adaptive-card-to-a-channel-can-i-remove-the

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
1.3k views
Welcome To Ask or Share your Answers For Others

1 Answer

For now, this is not possible.

According to Microsoft, this is by-design....

Link to Microsoft Tech Community Discussion

I have added a uservoice suggestion for Microsoft, to expand the schema to include options to do this. If you end up having the same issue as me, at least you can add weight to this feature request...

Link to Microsoft Uservoice Suggestion


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...