Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to using Adaptive Cards #38

Open
tormodfj opened this issue Jul 26, 2022 · 1 comment
Open

Upgrade to using Adaptive Cards #38

tormodfj opened this issue Jul 26, 2022 · 1 comment

Comments

@tormodfj
Copy link

With regards to the following note in the README:

As of 9/19/2019, for some reason you still cannot send AdaptiveCards, you need to use the older MessageCards with Teams Connectors.

This is no longer the case. Adaptive cards are now supported for ordinary Teams webhooks, albeit without templating support. All it takes is to attach the card to a "JSON envelope" of type message, and specifying the attachment content type application/vnd.microsoft.card.adaptive.

To manually test this, use Postman (or similar) to POST an HTTP request with the following raw body to a Teams webhook endpoint:

{
    "type": "message",
    "attachments": [
        {
            "contentType": "application/vnd.microsoft.card.adaptive",
            "contentUrl": null,
            "content": {
                "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
                "type": "AdaptiveCard",
                "version": "1.3",
                "body": [
                    {
                        "type": "TextBlock",
                        "text": "For Samples and Templates, see [https://adaptivecards.io/samples](https://adaptivecards.io/samples)"
                    },
                    {
                        "type": "Image",
                        "url": "https://adaptivecards.io/content/cats/1.png"
                    }
                ]
            }
        }
    ]
}

Result:

image

Upgrading to using Adaptive Cards will not only future-proof this app, but arguably make development and maintenance easier since one can use the Adaptive Cards Designer to tinker with and preview card layouts.

@MaceWindu
Copy link

For anyone interested in AdaptiveCard support - just released new app for it https://www.nuget.org/packages/Seq.App.Teams.AdaptiveCard/#readme-body-tab

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants