Your Alexa Dashboards Settings

Context

Context is a container used to communicate the state of your client components to AVS. Context should reflect the state of client components just before the event is fired. For example, if your client is playing an audio stream and a user interrupts that stream to make a speech request, when the Recognize event is sent to AVS, Context should indicate that the AudioPlayer’s playerActivity was playing.

The following example illustrates a SpeechRecognizer.Recognize event with all contexts included.

Click here to expand +

SpeechRecognizer.RecognizerState

Sample Message


{
    "header": {
        "namespace": "SpeechRecognizer",
        "name": "RecognizerState"
    },
    "payload": {
        "wakeword": "ALEXA"
    }
}

Payload Parameters

Parameter Description Type
wakeword Identifies the current wake word.
Accepted Value: "ALEXA"
string

AudioPlayer.PlaybackState

Sample Message

{
    "header": {
        "namespace": "AudioPlayer",
        "name": "PlaybackState"
    },
    "payload": {
        "token": "{{STRING}}",
        "offsetInMilliseconds": {{LONG}},
        "playerActivity": "{{STRING}}"
    }
}

Payload Parameters

Parameter Description Type
token This must match the token for the currently playing media item. Otherwise, the token must match what was provided in the last Play directive received. string
offsetInMilliseconds Identifies a track's current offset in milliseconds. long
playerActivity Identifies the component state of AudioPlayer.
Accepted Values: IDLE, PLAYING, STOPPED, PAUSED, BUFFER_UNDERRUN, and FINISHED.
string
Player Activity Description
IDLE Nothing was playing, no enqueued items.
PLAYING Stream was playing.
PAUSED Stream was paused.
BUFFER_UNDERRUN Buffer underrun.
FINISHED Stream was finished playing.
STOPPED Stream was interrupted.

Alerts.AlertsState

Sample Message

{
    "header": {
        "namespace": "Alerts",
        "name": "AlertsState"
    },
    "payload": {
        "allAlerts": [
            {
                "token": "{{STRING}}",
                "type": "{{STRING}}",
                "scheduledTime": "{{STRING}}"
            }
        ],
        "activeAlerts": [
            {
                "token": "{{STRING}}",
                "type": "{{STRING}}",
                "scheduledTime": "{{STRING}}"
            }
        ]
    }
}

Payload Parameters

Parameter Description Type
allAlerts Key/value pairs for allAlerts object
allAlerts. token Alert token returned by Alexa when the alert was set. string
allAlerts. type Identifies the alert type.
Accepted Values: TIMER, ALARM, REMINDER.
string
allAlerts. scheduledTime Time the alert is scheduled in ISO 8601 format. string
activeAlerts Key/value pairs for activeAlerts object
activeAlerts. token The token for the alert that is currently firing. string
activeAlerts. type Identifies the alert type.
Accepted Values: TIMER or ALARM
string
activeAlerts. scheduledTime Time the alert is scheduled in ISO 8601 format. string

Speaker.VolumeState

Sample Message

{
    "header": {
        "namespace": "Speaker",
        "name": "VolumeState"
    },
    "payload": {
        "volume": {{LONG}},
        "muted": {{BOOLEAN}}
    }
}

Payload Parameters

Parameter Description Type
volume Identifies current speaker volume.
Accepted Values: 0 to 100
long
muted Identifies mute state of the client's speaker. boolean

SpeechSynthesizer.SpeechState

Sample Message

{
    "header": {
        "namespace": "SpeechSynthesizer",
        "name": "SpeechState"
    },
    "payload": {
        "token": "{{STRING}}",
        "offsetInMilliseconds": {{LONG}},
        "playerActivity": "{{STRING}}"
    }
}

Payload Parameters

Parameter Description Type
token An opaque token provided in the Speak directive. string
offsetInMilliseconds Identifies the current offset of TTS in milliseconds. long
playerActivity Identifies the component state of SpeechSynthesizer.
Accepted Values: PLAYING or FINISHED
string
Player Activity Description
PLAYING Speech was playing.
FINISHED Speech was finished playing.

Notifications.IndicatorState

Sample Message

{
    "header": {
        "namespace": "Notifications",
        "name": "IndicatorState"
    },
    "payload": {
        "isEnabled": {{BOOLEAN}},
        "isVisualIndicatorPersisted": {{BOOLEAN}}
    }
}

Payload Parameters

Parameter Description Type
isEnabled Indicates there are new or pending notifications that have not been communicated to the user.

Note: Any indicator that has not been cleared is considered enabled.
boolean
isVisualIndicatorPersisted Corresponds to the persistVisualIndicator value of the last SetIndicator directive received. If persistVisualIndicator was true for the last directive received, upon reconnecting, isVisualIndicatorPersisted must be true. boolean

Additional Interfaces

Jump to the top of this document. Use the sidebar to navigate to additional interfaces.

Resources