Starting today, you can save and clone your Alexa Presentation Language (APL) documents in the authoring tool. In the past, saving your work required copying and pasting your JSON into a text editor of your choice. Now, you can create, save, edit, delete, clone, and download your visual assets in the APL authoring tool for a single skill, without even leaving your web browser. This simplifies the process of creating visuals with APL and makes collaborating with visual designers and others easier. In order to use a saved document within your skill code, keep in mind that the APL document must still be exported and added to your skill’s Lambda function or web service code. You can use the new save and clone features on all custom skills and Alexa-hosted skills. Learn more here.
To get started with building a multimodal skill, make sure that you configure your skill to support the Alexa.Presentation.APL interface. Navigate to the APL authoring tool to see a number of different templates you can use. You will be prompted with a pop up that asks if you would like to use the new experience. Select “Yes” if so.
You can start from scratch or use an existing sample template to create a new APL document. Click on “Save Template” in the upper-right corner to enter a name for the document. The template name is the name associated with the template in the authoring tool. If your document is not already associated with a skill, you need to also select the skill it should be associated with from the drop-down list.
Once you’ve saved the document, you’ll be able to view it on the Saved Templates page.
When you’re ready to edit your APL document, you can open a previously saved template by opening the skill where you saved it. Click on “Display”, and in the list of documents, find the document to open and click “Edit”.
You can also click on “Clone” to clone a template in the same skill by giving it a different name or associating the template with a different skill.
In your skill code, you can use the Alexa.Presentation.APL.RenderDocument directive to display your document on the screen. You must add your APL document to your skill’s Lambda function or web service code and use the RenderDocument directive to display your visual content on a device with a screen. You cannot use the name of the saved template in the authoring tool.
We also recommend that you use data binding to set text, image sources, and video source values to data sources instead of hard coding them into your saved APL documents, helping you to make your templates resusable and avoid storing sensitive data.
As always, feel free to ask questions in the ASK Developer Forums.