Stack Overflow: A New Way for Developers to Get Support for Alexa

Now you can find Alexa-specific tags and topics in the AWS Collective on Stack Overflow. Ask questions and get help from badged experts and the Alexa developer community!

question

DungBeetleBASH avatar image
DungBeetleBASH asked

Responding to bad applicationId in NodeJS Lambda function for Alexa skll

I'm creating an Alexa skill using NodeJS in AWS Lambda, following the same basic pattern as described in the How To sample app:

https://github.com/alexa/skill-sample-nodejs-howto

The Alexa Submission Checklist section, Verifying that Application ID in the Request Matches Your ID, states that:

"If the applicationId provided with the request does not match your ID, reject the request by returning an HTTP error code."

I understand that I need to verify the applicationId matches this.event.session.application.applicationId inside the intent handler, but I can't find a sample app or any example code that explains how to create the error response using the Alexa SDK. I'm assuming my application either needs to emit an error event or perhaps do something with the context object, but it's not clear what.

alexa skills kitlambdanode_js
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

DungBeetleBASH avatar image
DungBeetleBASH answered

I think I've found the answer:

this.context.fail("Invalid Application ID");
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.