question

Nico Leuchter avatar image
Nico Leuchter asked

Asynchronous Alexa.Safety ErrorResponse does not work

Hello,

I am currently facing the problem that my Safety Error Response does not work as expected. At least there is no reaction or a false reaction from Alexa like "Device is not responding..".

We planned to use the Safety Error Response in an async way. So in regards of the documentations:
https://developer.amazon.com/en-US/docs/alexa/device-apis/alexa-safety-errorresponse.html

https://developer.amazon.com/en-US/docs/alexa/device-apis/alexa-errorresponse.html


I expect that our payload needs to look like this:


{
   "event":{
      "header":{
         "namespace":"Alexa.Safety",
         "name":"ErrorResponse",
         "messageId":"Unique identifier, preferably a version 4 UUID",
         "correlationToken":"Opaque correlation token that matches the request",
         "payloadVersion":"3"
      },
      "endpoint":{
         "scope":{
            "type":"BearerToken",
            "token":"access-token-from-Amazon"
         },
         "endpointId":"Endpoint ID"
      },
      "payload":{
         "type":"OBSTACLE_DETECTED",
         "message":"There is an obstacle in the way."
      }
   }
}


In reality if I intercept the request against the Alexa Eventgateway it looks equal:


{
   "headers":{
      "Content-Type":[
         "application/json"
      ],
      "Authorization":[
         "Basic Atza|TOKEN"
      ]
   },
   "body":{
      "event":{
         "header":{
            "namespace":"Alexa.Safety",
            "name":"ErrorResponse",
            "messageId":"SOME_UUID",
            "payloadVersion":"3",
            "correlationToken":"MATCHING_CORRELATION_TOKEN"
         },
         "endpoint":{
            "endpointId":"DEVICE_ID",
            "scope":{
               "type":"BearerToken",
               "token":"Atza|TOKEN"
            }
         },
         "payload":{
           "type":"OBSTACLE_DETECTED",
           "message":"There is an obstacle in the way."
         }
      }
   }
}


My question is: Is it expected, that alexa says: "Device is not responding" instead of "Obstacle was detected, please check your garage" or something like this?

alexa skills
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Nico Leuchter avatar image
Nico Leuchter answered

As an addition, my payload is not a JSON containing the header and body.


My Payload is only this:


     {
       "event":{
         "header":{
            "namespace":"Alexa.Safety",
            "name":"ErrorResponse",
            "messageId":"SOME_UUID",
            "payloadVersion":"3",
            "correlationToken":"MATCHING_CORRELATION_TOKEN"
         },
         "endpoint":{
            "endpointId":"DEVICE_ID",
            "scope":{
               "type":"BearerToken",
               "token":"Atza|TOKEN"
            }
         },
         "payload":{
           "type":"OBSTACLE_DETECTED",
           "message":"There is an obstacle in the way."
         }
      }
   }
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Nico Leuchter avatar image
Nico Leuchter answered

Annother addition: The Alexa Gateway responds with http statuscode 202

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.