Amazon Alexa

Integration published by Jovo | 12,844 downloads

Build apps for Amazon's Alexa assistant platform

Response

Introduction

The response is the data that you send to the platform after processing the request. It consists of information like:

  • output, e.g. speech, audio, etc.
  • directives,
  • or session data

Here's an example response:

The main component is the output. Besides the platform independent output, Alexa provides multiple other types of output. You can find out more about that in Interfaces section of the documentation.

$response Object

The $response object supports a handful of cross-platform helper methods to get/set its values. You can find them in the general response docs.

Besides that, Alexa supports the following getter methods:

Name Description Return Value
getAplDirective() Returns APL object from response. APL object or undefined
getApltDirective() Returns the APLT object from response. APLT object or undefined
hasApltDirective() Checks if response has APLT directive. boolean
getAudioDirective() Returns Audio Player object from response. Audio object or undefined
getDirectives() Returns entire directives object from response. Directives object or undefined
getCard() Returns the card object from response. Card object or undefined
getDisplayDirective() Returns Display Template object from response. Display object or undefined
getVideoDirective() Returns Video Player object from response. Video object or undefined
hasAplDirective() Checks if response has APL directive. boolean
hasAskForAddressCard() Checks that Alexa permissions card is present and contains read::alexa:device:all:address boolean
hasAskForCountryAndPostalCodeCard() Checks that Alexa permissions card is present and contains read::alexa:device:all:address:country_and_postal_code boolean
hasAudioDirective() Checks if response has audio directive. boolean
hasDisplayDirective() Checks if response has display template directive. boolean
hasLinkAccountCard() Checks that Alexa LinkAcount card is present. boolean
hasSimpleCard(title?: string, text?: string) Checks if response has a simple Alexa card. If you parse any of the cards properties, the method will only return true if they are equal to the ones in the response. boolean
hasStandardCard(title?: string, text?: string, smallImageUrl?: string, largeImageUrl?: string) Checks if response has a standard Alexa card. If you parse any of the cards properties, the method will only return true if they are equal to the ones in the response. boolean
hasVideoDirective() Checks if response has video directive. boolean

Amazon Alexa Changelog

Jovo Marketplace | GitHub | npm

Current version might be higher than the latest changes displayed below because of updates of dependencies.

2021-10-27 [3.5.5]

2021-02-22 [3.5]

  • #901 Move setResponse from response to after.response middleware (@aswetlow)
  • #901 Route Alexa.Presentation.APLA.RuntimeError requests to ON_ERROR (@aswetlow)

2020-11-10 [3.2.1]

2020-08-21 [3.0.30]

3.0.17 (2020-05-13)

🐛 Bug fix

  • jovo-platform-alexa Fix http status in ReminderAPI

Committers: 1

3.0.13 (2020-05-04)

💅 Enhancements

  • jovo-platform-alexa #734 Add getPermissionIsCardThrown (@rmtuckerphx)
  • jovo-platform-alexa Add types for skill event body objects

Committers: 2

3.0.11 (2020-04-06)

  • Updated Typescript to 3.8.x
  • Updated Prettier to 2.x

Committers: 2

2.x

Find the 2.x changelog here.

Join Our Newsletter

Be the first to get our free tutorials, courses, and other resources for voice app developers.