Voice-Forward Consent API Reference
If your Alexa skill requires the user's information, you can enable the user to verbally consent to share that information with your skill. This feature is called voice-forward consent. To support voice-forward consent, your skill uses skill connections. Skill connections is an Alexa feature that enables a skill to call another skill or service to perform a specific task.
To implement voice-forward consent, your skill must do the following:
-
Pass control to the Amazon-owned voice consent skill at the point at which the user information is needed. To do so, your skill must send a
Connections.StartConnection
directive from a request handler. For details, see How to initiate the voice-forward consent flow. -
Receive control from the Amazon-owned voice consent skill through a
SessionResumedRequest
request, and handle the outcome accordingly. For details, see How to resume control after the voice-forward consent flow.
For details on where these items fit into voice-forward consent workflows, Standard voice-forward consent workflows. For details about using skill connections, see Use Skill Connections to Request Tasks.
The following sections describe the skill connection fields specific to the voice-forward consent flow.
Connections.StartConnection
directive schema
The following tables describe the fields within the Connections.StartConnection
directive.
Name | Required? | Type | Description |
---|---|---|---|
type |
Yes |
String |
Directive type. Set this to |
uri |
Yes |
String |
Resource that defines the task and the task version. Set this to |
input |
Yes |
Object |
An object that contains information about the task request. In this case, it contains a list of permission scopes to which the skill requests access. For details, see |
token |
No |
String |
A token that is returned to the skill as-is in the |
input object
Name | Required? | Type | Description |
---|---|---|---|
|
Yes |
String |
Task type. Set this to |
|
Yes |
String |
Task version. Set this to |
|
Yes |
Object |
A list of objects that specify which permissions to request from the user, and whether the permissions are at the account level or person level. For details, see Important: The maximum number of permission scope objects is five. If you provide more than five permission scopes, Alexa returns a
400 Invalid Request error to your skill. |
permissionScopes object
Name | Required? | Type | Description |
---|---|---|---|
|
Yes |
String |
The permissions to request from the user. For a list of valid permission scopes, see Overview of skill permissions. An example is |
|
Yes |
String |
The granularity of the user to which to ask for the consent. Valid values are
Important: If you specify a
consentLevel of PERSON and Alexa doesn't recognize the speaker, the voice consent attempt fails with a status of REDIRECT_TO_APP . |
SessionResumedRequest
schema
After attempting to get consent from the user, Alexa sends your skill a SessionResumedRequest
that contains the result of the voice-consent attempt.
The following tables describe the fields within the request
object of a SessionResumedRequest
.
Name | Type | Description |
---|---|---|
|
String |
The type of request, which is |
|
Object |
A string that the |
cause
object
Name | Type | Description |
---|---|---|
|
String |
The type of |
|
String |
A string that the |
|
Object |
A status code and message. For details, see |
|
Object |
The outcome of the voice-forward consent workflow. For details, see |
status
object
Name | Type | Description |
---|---|---|
|
String |
An HTTP status code that Alexa provides to your skill after processing the task request. Possible values:
|
|
String |
A message that describes the outcome of the request. |
result
object
Name | Type | Description |
---|---|---|
|
String enum |
A repeat of the |
|
String enum |
Enum string that indicates the result of the voice-forward consent. In all cases, the status code is 200. Valid values:
|
Related topics
- Use Voice-Forward Consent in Your Alexa Skill
- Understand Skill Connections
- Use Skill Connections to Request Tasks
- Add Personalization to Your Skill
Last updated: Mar 31, 2022