Test APL Examples with the Code Sandbox

Some Alexa Presentation Language (APL) examples in the documentation display in the code sandbox. For APL examples, you can see how a device with a screen renders the APL code. For APL for Audio examples, you can listen to the audio generated by the code. You can change the code and then see or hear how your changes are rendered.

Experiment with visual APL features

The preview pane automatically updates as you make changes in the code editor.

The onMount event handlers run when the sandbox loads and displays the APL document. Refresh the page or edit the code to reload the APL document and run these handlers again.

For example, the following document uses onMount to start the AutoPage command for a pager after two seconds. To reload the document and restart this command, refresh the page.

Most interactive features work in the sandbox. For example, you can test interactive components that run APL commands. Click to simulate touch events. Click and drag to simulate scrolling. For details about features not supported, see Sandbox limitations.

Listen to APL for audio examples in the sandbox

The audio sandbox requires a developer account to generate and play the audio. If you have an Amazon retail account, you must complete developer account registration before you can generate audio in the sandbox. For details about creating a new developer account or linking an Amazon.com account to a developer account, see Create Your Amazon Developer Account.

To listen to an example in the sandbox

  1. If you aren't signed in to the developer portal, click Sign in and follow the prompts to sign in with your developer account.
  2. Click Load Audio. This action generates the audio and displays a waveform that represents the sound. 3/ Click Play to hear the audio.

    To start playback from a different position or jump to a different position during playback, click in the time line.

If you make changes to the code, click Reload audio to generate a new clip that reflects your changes.

Sandbox limitations

  • The code editor doesn't save your changes. When you refresh the page or click the Reset button, the code shown in the editor reverts to its original state. The Reset button resets the APL Document / APLA Document and Data Sources tabs. Use the Copy button to copy your code to save or use within a skill.

Limitations (APL)

  • The sandbox doesn't support the Video component.
  • The sandbox doesn't connect to a skill, so you can't test the SendEvent command.
  • The sandbox doesn't support testing APL transformers, such as the textToHint or ssmlToSpeech transformer.
  • The sandbox doesn't support testing the VoiceView screen reader. Use a device to test a document for accessibility.

Limitations (APL for audio)

  • The sandbox behaves as an English US device. Examples play using the default US English voice unless you use the voice and lang Speech Synthesis Markup Language (SSML) tags with the Speech component.
  • The environment.alexaLocale property always returns en-US.

Known issues

  • For APL for audio, if you sign in with an Amazon.com account that isn't linked to a developer account, attempting to load the audio displays the error "We had an issue with the request. Please come back and try later." To solve this issue, complete the developer account registration. For details, see Create Your Amazon Developer Account.

Was this page helpful?

Last updated: Nov 28, 2023