Alexa.AuthorizationController.ErrorResponse Events

If Alexa sends an Alexa.AuthorizationController directive to your skill and you can't handle it successfully, respond with an Alexa.AuthorizationController.ErrorResponse event. For details, see Alexa.AuthorizationController Interface.

ErrorResponse event

In the payload for the Alexa.AuthorizationController.ErrorResponse, specify the type of the error and include a message with information about the error. For the list of Alexa.AuthorizationController error types, see Error type values.

ErrorResponse event payload details

Field Description Type Required
type The type of error. Alexa shares this with the customer. String Yes
message The error message for the error. Alexa doesn't share this with the customer. String Yes

ErrorResponse event format

Copied to clipboard.

{
"event": {
    "header": {
      "namespace": "Alexa.AuthorizationController",
      "name": "ErrorResponse",
      "messageId": "<message id>",
      "payloadVersion": "1.0"
    },
    "payload": {
      "type": "<error type>",
      "message": "<error message>"
    }
  }
}

Error type values

The following table shows the valid Alexa.AuthorizationController error type values.

Value Description
EXCEEDED_PIN_ATTEMPTS The user has entered an incorrect PIN too many times.
PIN_SETUP_REQUIRED The user hasn't set up their PIN code yet.
UNAUTHORIZED The PIN code is incorrect.

In addition to the Alexa.AuthorizationController error types, you can also use Alexa error types. 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.AuthorizationController error types, see Error type values.

Copied to clipboard.

{
  "event": {
    "header": {
      "namespace": "Alexa.AuthorizationController",
      "name": "ErrorResponse",
      "messageId": "<message id>",
      "payloadVersion": "1.0"
    },
    "endpoint":{
      "endpointId": "<endpoint id>"
    },
    "payload": {
      "type": "UNAUTHORIZED",
      "message": "The PIN code is not correct."
    }
  }
}

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.AuthorizationController error types, see Error type values.

Copied to clipboard.

{
  "event": {
    "header": {
      "namespace": "Alexa.AuthorizationController",
      "name": "ErrorResponse",
      "messageId": "<message id>",
      "correlationToken": "<an opaque correlation token>",
      "payloadVersion": "1.0"
    },
    "endpoint":{
      "scope":{
        "type":"BearerToken",
        "token":"access-token-from-Amazon"
      },
      "endpointId": "<endpoint id>"
    },
    "payload": {
      "type": "UNAUTHORIZED",
      "message": "The PIN code is not correct."
    }
  }
}