How do I format my JSON code for LiveTiles Bots?
Whether you are putting your JSON code into a bot response (such as in an answer to a QnA pair), or into the Welcome Message field within your bot settings, you will need to use the right format for your JSON code.
For Bots deployed to a webchat URL, the format of a JSON object is comprised of 3 main sections:
- The JSON adaptive card wrapper- This is the content type and contact declarations that allow the Bot platform to identify the resulting message as an adaptive card. The main adaptive vard JSON code that comes out of Microsoft's Adaptive Card builder needs to be wrapped in this header in order for the card to render and function properly
"content":[Insert Adaptive Card Content Here]
- The Body - This is the area of the JSON that defines the header images and text of the Adaptive Card according to the Microsoft Adaptive Card Elements and Container Schemas
- The Actions - This is the area of the JSON that defines the buttons, button text and resulting actions of the Adaptive Card according to the Microsoft Adaptive Card Actions Schemas. Only the "Submit", "OpenURL" and "ShowCard" actions are currently supported in accordance with version 1.1 of Adaptive Cards. The "Submit" action will result in a bot message response to be sent back to the Bot Framework, "OpenURL" will open the embedded URL in a separate tab or application and "ShowCard" will show a nested Adaptive Card
- Adaptive Card JSON objects for use in Teams Bots have the exact same setup as Webchat Bots, with one exception and this is the "Submit" action.
- Due to differences in the Teams framework, a variation of the JSON code needed to submit a message back to the Bot Framework is required as shown below. Notice the difference in the "Data" property:
|Webchat Deployment||Teams Deployment|
Please sign in to leave a comment.