What I am trying to do:
I have a very simple Alexa Skill which listens for a command word:
{
"intents": [{
"intent": "AffiliateEmpire",
"slots": [
{
"name": "affiliate_action",
"type": "AFFILIATE_ACTIONS"
},
{
"name": "date",
"type": AMAZON.DATE
}
}]
}
The custom slot type is:
AFFILIATE_ACTIONS commissions | earnings | sales | summary
My sample utterances are:
AffiliateEmpire for affiliate {affiliate_action}
AffiliateEmpire get {affiliate_action} for {date}
This communicates with my PHP server where I listen for the request type.
What is the problem?
When I invoke the command word without any intent, it makes a "LaunchRequest" to my server and correctly returns a card
and outputSpeech
If I ask for an intent, it makes an IntentRequest
to my server but then also sends a SessionEndedRequest
.
I handle the IntentRequest
and send it a json encoded response along the lines of:
array(
'version' => '1.0',
'response' => array(
'outputSpeech' => array(
'type' => 'PlainText',
'text' => 'Some simple response'
)),
'shouldEndSession' => true,
'sessionAttributes' => array()
));
My Amazon Echo never speaks the Some simple response
but instead gives me There was a problem communicating with the requested skill
I had a very similar skill working before this, but cannot see what I am doing wrong.
What I have tried.
I am using php to write a log file for each raw request, json_decoded request and the response I sent back to Amazon. I am also using the testing tool, however this gives me The remote endpoint could not be called, or the response it returned was invalid.
. I know it can call my endpoint as I see the log file written to each time.
Why is it calling my intent but then causing an error by ending the session?