Alexa.Cooking.ErrorResponse Events

If Alexa sends an Alexa.Cooking directive to your skill and you can't handle it successfully, respond with an Alexa.Cooking.ErrorResponse event. For an overview of the Alexa.Cooking interfaces, see Build Smart Home Skills for Cooking Appliances.

ErrorResponse event

In the payload for the Alexa.Cooking.ErrorResponse, specify the type of the error and include a message with information about the error. For the list of Alexa.Cooking 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 does not share this with the customer. String Yes

ErrorResponse event format

Copied to clipboard.

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

Error type values

The following table shows the valid Alexa.Cooking error types.

Error Type Description
CHILD_LOCK The child lock on the appliance is enabled.
COOK_DURATION_TOO_LONG The requested duration is too long for the appliance to run safely. When you send this error response, include a field in the payload named maxCookTime that indicates the maximum cook time allowed for the current cooking parameters. See example here.
DOOR_CLOSED_TOO_LONG The door has not been opened and closed recently and the appliance is likely empty. For example, an attempt to start cooking when no food is present.
DOOR_OPEN The appliance door is open. For example, an attempt to start cooking while the door is open.
PREHEAT_REQUIRED The appliance must be preheated.
PROBE_REQUIRED The temperature probe must be inserted.
REMOTE_START_NOT_SUPPORTED Cooking remotely is not currently supported by the device.
REMOVE_PROBE The temperature probe must be removed.
REMOTE_START_DISABLED Cooking remotely was disabled and must be re-enabled before cooking.

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

Copied to clipboard.

{
  "event": {
    "header": {
      "namespace": "Alexa.Cooking",
      "name": "ErrorResponse",
      "messageId": "<message id>",
      "payloadVersion": "3"
    },
    "endpoint":{
      "endpointId": "<endpoint id>"
    },
    "payload": {
      "type": "DOOR_OPEN",
      "message": "The microwave door is open."
    }
  }
}

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 more information, see Send Events to the Event Gateway.

For the list of Alexa.Cooking error types, see Error type values.

Copied to clipboard.

{
  "event": {
    "header": {
      "namespace": "Alexa.Cooking",
      "name": "ErrorResponse",
      "messageId": "<message id>",
      "correlationToken": "<an opaque correlation token>",
      "payloadVersion": "3"
    },
    "endpoint":{
      "scope":{
        "type":"BearerToken",
        "token":"access-token-from-Amazon"
      },
      "endpointId": "<endpoint id>"
    },
    "payload": {
      "type": "DOOR_OPEN",
      "message": "The microwave door is open."
    }
  }
}

COOK_DURATION_TOO_LONG

The following is an example error response for the COOK_DURATION_TOO_LONG error type. For the list of Alexa.Cooking error types, see Error type values.

Copied to clipboard.

{
  "event": {
    "header": {
      "namespace": "Alexa.Cooking",
      "name": "ErrorResponse",
      "messageId": "<message id>",
      "payloadVersion": "3"
    },
    "endpoint":{
      "endpointId": "<endpoint id>"
    },
    "payload": {
      "type": "COOK_DURATION_TOO_LONG",
      "message": "Cook time must not exceed 2 hours for the current settings.",
      "maxCookTime": "PT2H"
    }
  }
}