Alexa.Presentation.APLT Interface Reference
The Alexa.Presentation.APLT
interface provides directives for displaying content on a device with a character display, such as the LED 7-segment alphanumeric clock display on the Echo Dot with clock.
- Alexa.Presentation.APLT in supportedInterfaces
- RenderDocument directive
- ExecuteCommands directive
- Viewport object in the skill request
- Service Interface Reference (JSON)
- Related topics
Alexa.Presentation.APLT in supportedInterfaces
When the user's device has a character display that supports APL, the context.System.device.supportedInterfaces
object includes [Alexa.Presentation.APLT]
:
{
"version": "1.0",
"session": {},
"context": {
"System": {
"device": {
"deviceId": "amzn1.ask.device.1",
"supportedInterfaces": {
"AudioPlayer": {},
"Alexa.Presentation.APLT": {
"runtime": {
"maxVersion": "1.0"
}
}
}
},
"apiEndpoint": "https://api-amazonalexa.amazon.com",
"apiAccessToken": ""
},
"Viewports": [
{
"id": "main",
"type": "APLT",
"supportedProfiles": [
"FOUR_CHARACTER_CLOCK"
],
"lineLength": 4,
"lineCount": 1,
"format": "SEVEN_SEGMENT",
"interSegments": [
{
"x": 2,
"y": 0,
"characters": "':."
}
]
}
]
},
"request": {
"type": "LaunchRequest",
"requestId": "amzn1.echo-api.request.1",
"timestamp": "2019-06-27T15:52:19Z",
"locale": "en-US",
"shouldLinkResultBeReturned": false
}
}
Always check supportedInterfaces
before returning the Alexa.Presentation.APLT
directives.
RenderDocument directive
Instructs the device to display the APL content provided in the specified document
. You can also optionally provide one or more datasources
to bind content to document.
outputSpeech
and the RenderDocument
directive, Alexa says the entire outputSpeech
text before displaying the document.{
"type": "Alexa.Presentation.APLT.RenderDocument",
"token": "developer-provided-string",
"targetProfile": "FOUR_CHARACTER_CLOCK",
"document": {
"version": "1.0",
"type": "APLT",
"mainTemplate": {
"item": {
"type": "Text",
"id": "myTextId",
"textAlign": "right",
"text": "GOOd dAy",
"overflow": "marquee"
}
}
},
"datasources": {}
}
Name | Description | Type | Required |
---|---|---|---|
|
Map of data source objects to provide data to the document. Use this to separate your template from the data. See Data-binding Evaluation and Data-binding syntax. |
Object |
No |
|
The APL document to display. |
Object |
Yes |
|
The device profile to target. Set to a device profile supported by the user's device, as indicated in the request in the |
Enum |
No |
|
A unique identifier for the presentation. Each document is considered an independent presentation. This is used to associate future events and directives with the appropriate presentation. |
String |
Yes |
|
Always |
String |
Yes |
ExecuteCommands directive
Instructs the device to run the provided commands
.
token
in the ExecuteCommands
directive that matches the token
provided with the RenderDocument
directive used to display the document.{
"type": "Alexa.Presentation.APLT.ExecuteCommands",
"token": "developer-provided-string",
"commands": [
{
"type": "SetValue",
"description": "Changes the text property value on the 'myTextId' component.",
"componentId": "myTextId",
"property": "text",
"value": "New text value!",
"delay": 3000
}
]
}
Name | Description | Type | Required |
---|---|---|---|
|
An array of Command objects to run. Providing more than one commands is equivalent to using the |
Array of Command |
Yes |
|
The unique identifier for the current presentation. Must match the token provided by the skill in the RenderDocument directive used to render the currently-displayed document. |
String |
Yes |
|
Always |
String |
Yes |
Viewport object in the skill request
Every request sent to your skill includes information about the supported viewports for the user's device. You can use this information in your code to craft appropriate responses.
For a device with a character display, the viewport information is in the context.Viewports
array. This array contains one or more viewport
objects representing the supported viewports for the device. The type
property indicates whether the object represents a device that supports APL for screen devices (APL
) or a device that supports APL for character devices (APLT
).
This example shows the Viewports
array for a device with a character display:
{
"version": "1.0",
"session": {},
"context": {
"system": {
"device": {
"deviceId": "String",
"supportedInterfaces": {
"AudioPlayer": {},
"Alexa.Presentation.APLT": {
"runtime": {
"maxVersion": "1.0"
}
}
}
}
},
"Viewports": [
{
"id": "main",
"type": "APLT",
"supportedProfiles": ["FOUR_CHARACTER_CLOCK"],
"lineLength": 4,
"lineCount": 1,
"format": "SEVEN_SEGMENT",
"interSegments": [
{
"x": 2,
"y": 0,
"characters": "':."
}
]
}
]
},
"request": {}
}
Properties in the viewport
object:
Name | Description | Type |
---|---|---|
|
Shape of the characters on the display. Currently can be |
Enum |
|
Unique identifier for the viewport. |
String |
|
Array of inter-segment characters supported by the display. For example, this identifies the placement of characters such as the colon ( |
Array of interSegment objects |
|
Height of the display in characters. A 4x1 device such as the Echo Dot with clock has a ` of 1. |
Integer |
|
Width of the display in characters. A 4x1 device such as the Echo Dot with clock has a |
Integer |
|
A list of display types supported by the device. Currently can contain |
Array of Enum |
|
|
Enum |
Service Interface Reference (JSON)
Request Format and Standard Request Types:
- Request and Response JSON Reference
- Request Types Reference (LaunchRequest, IntentRequest, SessionEndedRequest)
- Alexa.Presentation.APL Interface
- Alexa.Presentation.APLT Interface (this document)
- Alexa.Presentation.HTML Interface
- AudioPlayer Interface
- Connections Interface
- Dialog Interface
- Messaging Interface
- PlaybackController Interface
- VideoApp Interface
Related topics
- Understand Alexa Presentation Language and Character Displays
- Use APL with the ASK SDK v2
- APL Document
Last updated: May 10, 2024