0
votes

In my Alexa skill, I'm broadcasting an MP3 file through AudioPlayer Directive.

As the file starts playing, I get:

{
   "type": "AudioPlayer.PlaybackStarted",
   "requestId": "requestId",
   "timestamp": "2018-02-28T13:17:54Z",
   "locale": "en-US",
   "token": "tokenstring",
   "offsetInMilliseconds": 0
}

My service does not generate a response to this event, but I receive this error immediately:

{
   "type": "System.ExceptionEncountered",
   "requestId": "requestId,
   "timestamp": "2018-02-28T13:17:55Z",
   "locale": "en-US",
   "error": {
      "type": "INVALID_RESPONSE",
      "message": "An exception occurred while dispatching the request to the skill."
   },
   "cause": {
      "requestId": "amzn1.echo-api.request.8492b40e-1698-409f-8bed-61dc1f3de663"
   }
}

In the documents it says I don't have to respond to this event, but is there something mandatory I need to send back to the Alexa? Maybe an HTTP status?

1

1 Answers

1
votes

I found your question while looking for the same answer for myself.

I also found some notes in the Amazon Developer forums that there were some changes made some time back to require a response, but that documentation hadn't been fully updated...

I've added this below and its cleared up the issue for me.

if(event.request.type == 'AudioPlayer.PlaybackStarted' || event.request.type 
== 'AudioPlayer.PlaybackStopped') {
     response = {
      "version": "1.0",
      "response": {
        "shouldEndSession": true
      }
    };
  }

Hope that helps.