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.
Webchat
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
{
"contentType": "application/vnd.microsoft.card.adaptive",
"content":[Insert Adaptive Card Content Here]
}
Example:
- 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
Example:
- 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
Example:
Teams
- 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 |
0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
0 Kommentare