Hi,
I applied for certification after following the skill-sample guide and got below response from Amazon.
"Future versions of the Alexa Skills Kit may add new properties to the JSON request and response formats, while maintaining backward compatibility for the existing properties. When we invoke the skill with additional parameters, the skill is rejecting it when we expect this to be accepted. Your code must be resilient to these types of changes. For example, your code for de-serializing a JSON request must not break when it encounters a new, unknown property."
However, i tried and added multiple extra elements in the request and the response always returned 200.
Below is my lambda function:
'use strict';
var Alexa = require('alexa-sdk');
var APP_ID = "amzn1.ask.skill.f472dac6-e6ca-48bb-9dfb-4d34c009b975";
var SKILL_NAME = "Cricket Facts";
var GET_FACT_MESSAGE = "Here's your fact: ";
var HELP_MESSAGE = "You can say tell me a cricket fact, or, you can say exit... What can I help you with?";
var HELP_REPROMPT = "What can I help you with?";
var STOP_MESSAGE = "Goodbye!";
var data = [
"It is said that cricket originated in England. Since they used to raise sheep, the grass was so short that it was possible to roll a lump of wool on it which they used as a ball.",
"The first recorded game was played in 1646, and later fines were handed out for those who missed the church to play.",
"In the 1760’s, pitching a ball through the air was considered normal, thus the bat shape changed from a curve to a straight one.",
"The longest cricket match took place in 1939 between England and South Africa, after 14 days it ended with a tie.",
"The two most common causes for pausing or suspending a cricket game is rain and bad light.",
"When a batsman scores 100 runs, it called a century and is considered an achievement.",
"A cricket game was once stopped because a pig ran across the field. It is even considered legal to suspend the game if an animal entered the field.",
"Only one player can run out at a time. Usually left for the umpire to decide.",
"A cricket game has two umpires in the field and one off the field.",
"Despite being a team game, individuals are stressed upon and put under pressure.",
"Shahid Afridi used Sachin Tendulkar's bat to hit the fastest ever ODI century.",
"Chris Gayle is the only batsman to hit a six off the first ball of a Test match",
"Abbas Ali Baig was the first Indian cricketer to be kissed during a Test",
"Vinod Kambli's Test match average is better than his childhood friend Sachin Tendulkar",
"Sunil Gavaskar was out off the first ball of a Test match thrice in his career",
"ML Jaisimha and Ravi Shastri are the only Indians to bat on all five days of a Test",
"The only cricketer to play Test cricket for India and England is Saif Ali Khan’s grandfather, Iftikhar Ali Khan Pataudi",
"Lala Amarnath is the only bowler to dismiss Don Bradman hit wicket in Test cricket",
"There's an uncanny similarity between the Indo-Pak match at the Australasia Cup of 1986 and Asia Cup 2014",
"India won the 1983 World Cup and won their first ever Test at Lord’s three years later in 1986.",
"India won their second World Cup 28 years later in 2011 and remarkably won their second ever Test at Lord’s three years later in 2014.",
"India is the only country to win the 60-Over, 50-Over and 20-Over World Cup",
"Alec Stewart was born on 8-4-63 and he scored 8463 Test runs",
"Asif Karim of Kenya has played International cricket and Davis Cup (Tennis) for his country",
"Wilfred Rhodes of England played Test cricket till he was 52!",
"Allan Border played 153 consecutive Test matches",
"The only Indian Test cricketer to be knighted is Maharaja of Vizianagaram",
"Australia beat England by 45 runs in the first ever cricket Test as well as the Centenary Test in 1977",
"All four innings of a test on the same day",
"There's only one person who witnessed Jim Laker and Anil Kumble taking 10 wickets in an innings",
"On the morning of 11/11/11 South Africa needed 111 runs to win at 11:11",
"Peter Siddle is the only bowler to take a hat-trick on his birthday",
"India's Mohinder Amarnath is the only cricketer to be dismissed for handling the ball and obstructing the field",
"West Indies' Leslie Hylton is the only cricketer to be hanged for murder",
"Two Robin Singhs have played Test cricket for India and both never got to play after their debut Test",
"Sachin Tendulkar played for Pakistan before India"
];
//=========================================================================================================================================
//Editing anything below this line might break your skill.
//=========================================================================================================================================
exports.handler = function(event, context, callback) {
var alexa = Alexa.handler(event, context);
alexa.APP_ID = APP_ID;
alexa.registerHandlers(handlers);
alexa.execute();
};
var handlers = {
'LaunchRequest': function () {
this.emit('GetNewFactIntent');
},
'GetNewCricketFact': function () {
var factArr = data;
var factIndex = Math.floor(Math.random() * factArr.length);
var randomFact = factArr[factIndex];
var speechOutput = GET_FACT_MESSAGE + randomFact;
this.emit(':tellWithCard', speechOutput, SKILL_NAME, randomFact)
},
'AMAZON.HelpIntent': function () {
var speechOutput = HELP_MESSAGE;
var reprompt = HELP_REPROMPT;
this.emit(':ask', speechOutput, reprompt);
},
'AMAZON.CancelIntent': function () {
this.emit(':tell', STOP_MESSAGE);
},
'AMAZON.StopIntent': function () {
this.emit(':tell', STOP_MESSAGE);
}
};
Any help to understand what validation is failing? Sample request is below:
{
"session": {
"sessionId": "SessionId.8cf178d5-5687-4b6a-b8f8-dc422e186c2d",
"junkParam": "junkValue",
"application": {
"applicationId": "amzn1.ask.skill.f472dac6-e6ca-48bb-9dfb-4d34c009b975",
"junkParam": "junkValue"
},
"attributes": {
"junkParam": "junkValue"
},
"user": {
"userId": "amzn1.ask.account.AHEBAL5FTGHIGN67OVCPN3Z6YNVBSLA624DION4IYK7URUFGC3NNVI5ZGACWUBEO2FRJWJTR7S5YM62VZT4HM2R3LPQPDV666GCIIAM7ZJJBMO2ZCJSOCTJ4TMKHNRGA5S2TDY2BSSRM4DOQRLFW63LLLER72HV5YJ4IS3QIRALAMLWSKNER566S2JLFV43YRDEXZXOIH3TC6VQ",
"junkParam": "junkValue"
},
"new": true
},
"request": {
"type": "IntentRequest",
"junkParam": "junkValue",
"requestId": "EdwRequestId.d9bb38de-aa58-4981-a32b-e1d32701d1f9",
"locale": "en-US",
"timestamp": "2017-06-06T02:15:01Z",
"intent": {
"name": "GetNewCricketFact",
"junkParam": "junkValue",
"slots": {}
}
},
"version": "1.0"
}
Regards,
Navin