Currently at this stage of tutorial:
Got to the very end, but have problems with this part:
Great! You now have added all of the functions you need to support your first API definition. There is still one final change you need to make. You need to register GetRecommendationAPIHandler with the SDK otherwise your handler will never execute even if the income request is a Dialog.API.Invoked request for the getRecommendation API.
i. Scroll the bottom of the file and look for .addRequestHandlers
j. Add a new line and paste GetRecommendationAPIHandler, onto the new line.
exports.handler = skillBuilder .addRequestInterceptors(RequestInterceptor) .addRequestHandlers( GetRecommendationAPIHandler, SessionEndedRequestHandler ) .addResponseInterceptors(ResponseInterceptor) .addErrorHandlers(ErrorHandler) .lambda();
Now it looks like this:
exports.handler = Alexa.SkillBuilders.custom() .addRequestHandlers( GetRecommendationAPIHandler, SessionEndedRequestHandler, LaunchRequestHandler, HelloWorldIntentHandler, HelpIntentHandler, CancelAndStopIntentHandler, SessionEndedRequestHandler, IntentReflectorHandler, // make sure IntentReflectorHandler is last so it doesn't override your custom intent handlers ) .addErrorHandlers( ErrorHandler, ) .lambda();
What should I do? Replace all this part completely? I did add the line "GetRecommendationAPIHandler", but when I try adding line ".addResponseInterceptors(ResponseInterceptor)" I get error mark that ResponseInterceptor doesn't exist.
I am not really familiar with JS so can't understand on my own.
I tried saving and building without it. It asks required questions, but doesn't give the expected result, I guess it's because code isn't fully completed.
Can you please help? I am following the tutorial step-by-step.