Search code examples
c#botframeworkbotsadaptive-cards

Build Adaptive card using Microsoft C# library or JSON Schema?


I am new to building webchat bot. I have one built one webchat bot in C# using the Microsoft Bot framework. I now need to add an Adaptive card to the app, my basic question is - Should I build the adaptive card using the Microsfot.AdaptiveCard library and the C# code or using the JSON schema? The reason for this question is I should be able to reuse the webchat bot code to any other platform/channel like Facebook, Slack, Apple iMessenger etc. and not limit to C#.


Solution

  • You're right -- sticking to JSON Schema is a good idea and will ensure that when you're using cards in other channels you don't have to convert & save from the C# Adaptive Cards library to a format the channels can read. In case you haven't seen these docs yet, here are the getting started docs for Adaptive Cards, and you can use the Schema Explorer and Visualizer to help build your cards.

    This is irrelevant to you if if you're using JSON Schema, but to anyone who decides to use the AC Library, please note: The Adaptive Cards package has been updated from Microsoft.AdaptiveCards to AdaptiveCards, as well as a few other breaking changes.