Alexa.DataController.ErrorResponse Events
If Alexa sends an Alexa.DataController
directive to your skill and you can't handle it successfully, respond with an Alexa.DataController.ErrorResponse
event. For details, see Alexa.DataController
.
ErrorResponse event
In the payload for the Alexa.DataController.ErrorResponse
, specify the type of the error and include a message with information about the error. For the list of Alexa.DataController
error types, see Error type values.
ErrorResponse event parameters
Property | Description | Type | Required |
---|---|---|---|
|
Type of error. Alexa shares this with the customer. |
String |
Yes |
|
Descriptive message for the error. Alexa doesn't share this with the customer. |
String |
Yes |
ErrorResponse event example
{
"event": {
"header": {
"namespace": "Alexa.DataController",
"name": "ErrorResponse",
"messageId": "a unique identifier, preferably a version 4 UUID",
"correlationToken": "correlation token received in the directive",
"payloadVersion": "1"
},
"endpoint": {
"scope": {
"type": "BearerToken",
"token": "OAuth2 bearer token"
},
"endpointId" : "the endpoint identifier" ,
},
"payload": {
"type": "<error type>",
"message": "<error message>"
}
}
}
Error type values
The following table shows the valid Alexa.DataController
error types.
Property | Description |
---|---|
|
The device doesn't support data deletion. |
|
The device doesn't support data retrieval. |
In addition to the Alexa.DataController.ErrorResponse
error types, you can also use Alexa error types, such as INVALID_VALUE
. For details, see Alexa.ErrorResponse
error type values.
Examples
Synchronous response example
The following is an example error response that you send synchronously to Alexa. For the list of Alexa.DataController.ErrorResponse
error types, see Error type values.
{
"event": {
"header": {
"namespace": "Alexa.DataController",
"name": "ErrorResponse",
"messageId": "message id",
"correlationToken": "correlation token received in the directive",
"payloadVersion": "1"
},
"endpoint":{
"endpointId": "endpoint id"
},
"payload": {
"type": "DATA_DELETION_NOT_SUPPORTED",
"message": "This endpoint does not support data deletion."
}
}
}
Asynchronous response example
The following is an example error response that you send asynchronously to the Alexa event gateway. If you respond asynchronously, include a correlation token and a scope with an authorization token. For details, see Send Events to the Event Gateway.
For the list of Alexa.DataController
error types, see Error type values.
{
"event": {
"header": {
"namespace": "Alexa.DataController",
"name": "ErrorResponse",
"messageId": "message id",
"correlationToken": "correlation token received in the directive",
"payloadVersion": "1"
},
"endpoint":{
"scope":{
"type": "BearerToken",
"token": "OAuth2 bearer token"
},
"endpointId": "endpoint id"
},
"payload": {
"type": "DATA_RETRIEVAL_NOT_SUPPORTED",
"message": "This endpoint does not support data retrieval by id."
}
}
}