Build Documents with the APL Authoring Tool
Use the APL Authoring Tool to build and preview an APL document. You can start from a blank document, start from a sample template, or import an animation in Lottie format to create your document. When finished, use the
RenderDocument directive to display your visual response on the screen or play your audio document.
Create and edit an APL document
An APL document is a JSON structure that defines a template for a skill response. The document can define either a visual response or an audio response.
Use the authoring tool to create an APL document from a pre-built template, from a Lottie animation, or from a blank document.
For details about creating and editing APL documents, see Create and Edit an APL Document.
Import a Lottie animation
For details about importing a Lottie animation to use in your APL document, see Import a Lottie Animation.
Import and export an APL document
Although the authoring tool saves your work with your skill, you can also export an APL document in JSON format. Export creates a JSON file with the document and data source. You can import a previously-exported document to create a new document.
For details about import and export, see Import and Export APL Documents.
Preview an APL document
Use the authoring tool to preview how your document renders to your users.
For a visual response, you can see how the document looks on devices of different sizes and preview tap events, commands, video, and other aspects of the document. For an audio response, you can listen to the audio clip generated by the document.
For details about previewing and testing your document in the authoring tool, see Preview an APL Document.
Integrate your APL document into your skill response
To use your APL document in your skill, you include the
RenderDocument directive in the response your skill sends to Alexa. For a visual response, Alexa displays the document on the screen. For an audio response, Alexa plays the audio generated from the document.
When you send the
RenderDocument directive, you must provide the document you want to display or play. There are two different options for providing the document:
- Save the document in the authoring tool and pass a link to the document to the
RenderDocumentdirective. Your document remains in the authoring tool, and changes you make in the tool are reflected in the skill response. For details, see the following:
- Copy the JSON for the document into your skill code and pass the full JSON for the document to the
RenderDocumentdirective. When you make future changes to the document, you must update your skill code.
For details about exporting the JSON for your document, see Import and Export APL Documents
For details about
RenderDocument, see the following:
- APL for a visual response: Alexa.Presentation.APL Interface Reference.
- APL for an audio response: Alexa.Presentation.APLA Interface Reference.
For examples that show how to send
RenderDocument with the ASK SDK, see Use Alexa Presentation Language with the ASK SDK v2.