0
votes

Created a new aws-lambda function and tests are also executed fine. Then I created a new Alexa skill and configured everything and even added Display Interface under Interface section. But when I try to execute my commands in Alexa simulator

alexa skill

Its response is like There was a problem with the requested skill's response. And Skill I/O json files looks like

Input Json :

{  
   "version":"1.0",
   "session":{  
      "new":true,
      "sessionId":"amzn1.echo-api.session.2739cca3-6804-4872-b137-a4d33bca1d76",
      "application":{  
         "applicationId":"amzn1.ask.skill.c5444c1d-574f-44fe-981e-351b08cab8b6"
      },
      "user":{  
         "userId":"amzn1.ask.account.AGMVQCXC6XYWORU62MNGISCR6ECHRTHHSBKNIDWFBQDKL66AQDHERNVOA2K5VI32G6HZMYN7GYVGSRWSVFPQWDBCJ2WVUBXJ2AY6F5T374UYHH7ZFOOWJKPJV6KYSNOMXXIDY5C2KUJ4ID7GHXELOH23CKN6WHVLQREOCQXANHDOLDKL722UBIZZFPE4MJAU5S5TCHL5HGOZO6Y"
      }
   },
   "context":{  
      "AudioPlayer":{  
         "playerActivity":"IDLE"
      },
      "Display":{  

      },
      "System":{  
         "application":{  
            "applicationId":"amzn1.ask.skill.c5444c1d-574f-44fe-981e-351b08cab8b6"
         },
         "user":{  
            "userId":"amzn1.ask.account.AGMVQCXC6XYWORU62MNGISCR6ECHRTHHSBKNIDWFBQDKL66AQDHERNVOA2K5VI32G6HZMYN7GYVGSRWSVFPQWDBCJ2WVUBXJ2AY6F5T374UYHH7ZFOOWJKPJV6KYSNOMXXIDY5C2KUJ4ID7GHXELOH23CKN6WHVLQREOCQXANHDOLDKL722UBIZZFPE4MJAU5S5TCHL5HGOZO6Y"
         },
         "device":{  
            "deviceId":"amzn1.ask.device.AG6K3BI3PXMWLBUTDHHUIYBJCEEYRCTYIW7YCRT7U53VFQHRAGF6HVTOIHBR2KDVWPZHMRUJKQOYZRYA6V3CY7AJE6UYBA6NYAFYKCYPNX4HHHEOKXTX7BAQUG3BZQIPIO3FWSVXX4V4VIAPWPHPRSYJSSYOJYXBR6R6LBIEO4MODOO5QD4TM",
            "supportedInterfaces":{  
               "AudioPlayer":{  

               },
               "Display":{  
                  "templateVersion":"1.0",
                  "markupVersion":"1.0"
               }
            }
         },
         "apiEndpoint":"https://api.eu.amazonalexa.com",
         "apiAccessToken":"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6IjEifQ.eyJhdWQiOiJodHRwczovL2FwaS5hbWF6b25hbGV4YS5jb20iLCJpc3MiOiJBbGV4YVNraWxsS2l0Iiwic3ViIjoiYW16bjEuYXNrLnNraWxsLmM1NDQ0YzFkLTU3NGYtNDRmZS05ODFlLTM1MWIwOGNhYjhiNiIsImV4cCI6MTUzNDQ4NzI4OSwiaWF0IjoxNTM0NDgzNjg5LCJuYmYiOjE1MzQ0ODM2ODksInByaXZhdGVDbGFpbXMiOnsiY29uc2VudFRva2VuIjpudWxsLCJkZXZpY2VJZCI6ImFtem4xLmFzay5kZXZpY2UuQUc2SzNCSTNQWE1XTEJVVERISFVJWUJKQ0VFWVJDVFlJVzdZQ1JUN1U1M1ZGUUhSQUdGNkhWVE9JSEJSMktEVldQWkhNUlVKS1FPWVpSWUE2VjNDWTdBSkU2VVlCQTZOWUFGWUtDWVBOWDRISEhFT0tYVFg3QkFRVUczQlpRSVBJTzNGV1NWWFg0VjRWSUFQV1BIUFJTWUpTU1lPSllYQlI2UjZMQklFTzRNT0RPTzVRRDRUTSIsInVzZXJJZCI6ImFtem4xLmFzay5hY2NvdW50LkFHTVZRQ1hDNlhZV09SVTYyTU5HSVNDUjZFQ0hSVEhIU0JLTklEV0ZCUURLTDY2QVFESEVSTlZPQTJLNVZJMzJHNkhaTVlON0dZVkdTUldTVkZQUVdEQkNKMldWVUJYSjJBWTZGNVQzNzRVWUhIN1pGT09XSktQSlY2S1lTTk9NWFhJRFk1QzJLVUo0SUQ3R0hYRUxPSDIzQ0tONldIVkxRUkVPQ1FYQU5IRE9MREtMNzIyVUJJWlpGUEU0TUpBVTVTNVRDSEw1SEdPWk82WSJ9fQ.QAuP9lSUeLOUs6NPf7Y90CRR1eXnz-2_hnL3Lut6Dq9pPOrgKlCr_fUklwJlrA04XU7RdxTxxw7plpQ6HxzqLowxxn2ERH3ex1zMC24erXLym2XYalEOcWkBJNlJlL-S4a06Jk8hYRJaATK-VhKxRuiKyfvwE0Pkb2p91EnXayueEuSMCZ7ChpARabujzKJ-I_dw8UsTDaYbR1wrBbDwZbxRxFX7ieiN3rG9TiJM8EjydUJIWXBmzP-FMzhW4hk9b0CPQxLLyFspl5XqKGzI6xMMMHl-3yFliqawZFcoiWbHjkSeBuu7jHeHtAYbH5Zu5tyaL1fcuFWT1pMZJInfQQ"
      }
   },
   "request":{  
      "type":"LaunchRequest",
      "requestId":"amzn1.echo-api.request.90ad6d97-86bc-473b-ac50-31fd2d100c89",
      "timestamp":"2018-08-17T05:28:09Z",
      "locale":"en-US",
      "shouldLinkResultBeReturned":false
   }
}

output Json :

{
   "body":{
      "version":"1.0",
      "response":{
         "outputSpeech":{
            "type":"SSML",
            "ssml":"Welcome to your personal Tableau assitent. How may i help you today?"
         },
         "card":{
            "type":"Simple",
            "title":"Tableau Insights!",
            "content":"Welcome to your personal Tableau assitent. How may i help you today?"
         },
         "reprompt":{
            "outputSpeech":{
               "type":"PlainText",
               "text":"How may i help you today?"
            }
         },
         "shouldEndSession":false
      },
      "sessionAttributes":{
         "speechOutput":"Welcome to your personal Tableau assitent. How may i help you today?",
         "repromptText":"How may i help you today?"
      }
   }
}

And the index.js file is here.

1
Did you try this in the device?Suneet Patil
Nope... But will it cause problems while running on simulators?Prateek Naik
Yea for few of interfaces, simulator won’t supportSuneet Patil

1 Answers

1
votes

When you use SSML response type always include <speak> tag.

In your LaunchRequest response, outputSpeech type is set to SSML and you have passed a plain text. You should enclose SSML response with a bare minimum <speak> ... </speak>

"outputSpeech":{
            "type":"SSML",
            "ssml":"<speak> Welcome to your personal Tableau assitent. How may i help you today? </speak>"
         },

More on SSML here

Also, check out the ask-nodejs-sdk which will take care of these things and you can further reduce your development effort.