Buttons and Cards now support Adaptive Cards 1.2
May 20, 2020We've made several improvements to Buttons and Cards that we're pleased to share with you. Buttons and Cards, which use Microsoft's Adaptive Cards framework, add interactivity to messages in Webex. Starting today, you can now:
- Design and build cards right here on Webex for Developers with an interactive Buttons & Cards Designer
- Use new elements and properties from Adaptive Cards 1.2
- Ensure that cards you've created are well-formed and will be sent without error with instant validation from the Messages API
Let's dig into each of these features.
Buttons and Cards Designer
The new Buttons and Cards Designer is now available here on Webex for Developers: https://developer.webex.com/buttons-and-cards-designer
The designer lets you design cards with an interactive GUI. Once your card is ready, use the linked JSON to send your card. Spend less time worrying about the card's JSON syntax and spend your energy on more important tasks.
Support for Adaptive Cards 1.2
Elements and Properties added to your arsenal from the Adaptive Card 1.2 release include:
RichTextBlock
TextRun
ActionSet
fontType
forTextBlock
bleed
,minHeight
properties forContainer
style
,bleed
,minHeight
properties forColumnSet
bleed
,minHeight
, properties forColumn
inlineAction
property forInput.Text
wrap
property forInput.Toggle
wrap
property forInput.ChoiceSet
backgroundImage
property ofadaptiveCard
and container
Here are a few examples of how you might leverage the new 1.2 schema elements.
The RichTextBlock
and TextRun
elements provide a set of attributes that give you fine grained control over the formatting of text in a card, enabling cards with text that looks like this:
The new ActionSet
element provides you with freedom to include action buttons anywhere in the card and not just at the end of a card:
We encourage you to play around with all of the elements that are now available in the new Buttons and Cards Designer.
There are still a few Adaptive Card schema elements and attributes which are not supported by Webex:
Media
speak
andverticalContentAlignment
property for Adaptive Cardsfallback
andrequires
property on the Element levelheight
property for theColumnSet
Action.ToggleVisibility
forActionSet
orActions
Enhanced Validation Support
To help make it more obvious which aspects of the Adaptive Card schema we do and don’t support, we have enhanced the Messages API validation for messages with card attachments. Requests that receive an HTTP 200 response will always result in an attempt to render the card, while responses with a non-200 response will not. The endpoint will return 400 responses with clear error messages in cases where your card uses an unsupported “version” field or includes any of the unsupported elements or attributes. If the card's JSON is malformed, you will receive an HTTP 400 response right away.
A few examples can be seen here:
We're excited to bring you these new time-saving features for Buttons and Cards. If you have product feedback or if you have any questions, please reach out to Webex Developer Support.