Skip to content

Instantly share code, notes, and snippets.

@rekire
Created January 10, 2018 15:59
Show Gist options
  • Save rekire/c4d28dcc1d1b0aff5b82ff8a93ef3545 to your computer and use it in GitHub Desktop.
Save rekire/c4d28dcc1d1b0aff5b82ff8a93ef3545 to your computer and use it in GitHub Desktop.
Example JSON for the ListTemplate2
{
"version": "1.0",
"sessionAttributes": {},
"response": {
"outputSpeech": {
"type": "PlainText",
"text": "Hallo",
"ssml": "<speak>Hallo</speak>"
},
"reprompt": {
"outputSpeech": {
"type": "PlainText",
"ssml": "<speak>Are you still there?</speak>"
}
},
"directives": [
{
"type": "Display.RenderTemplate",
"template": {
"type": "ListTemplate2",
"token": "token",
"backButton": "HIDDEN",
"backgroundImage": {
"contentDescription": "Background",
"sources": [
{
"url": "http://www.example.com/background.jpg"
}
]
},
"title": "Calories in 1 Serving of Cheese",
"listItems": [
{
"token": "cheese1",
"image": {
"contentDescription": "desc1",
"sources": [
{
"url": "http://www.example.com/gouda.jpg"
}
]
},
"textContent": {
"primaryText": {
"text": "Gouda",
"type": "PlainText"
},
"secondaryText": {
"text": "Serving size: 1oz (28g)",
"type": "PlainText"
},
"tertiaryText": {
"text": "100 cal",
"type": "PlainText"
}
}
},
{
"token": "cheese2",
"image": {
"contentDescription": "desc2",
"sources": [
{
"url": "http://www.example.com/sharp-cheddar.jpg"
}
]
},
"textContent": {
"primaryText": {
"text": "Sharp Cheddar",
"type": "PlainText"
},
"secondaryText": {
"text": "Serving size: 1slice (28g)",
"type": "PlainText"
},
"tertiaryText": {
"text": "113 cal",
"type": "PlainText"
}
}
}
]
}
}
],
"shouldEndSession": true
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment