question

Rand M avatar image
Rand M asked

Java equivalent for index.js APP_ID variable?

In the README.TXT files for the example node.js skills under the "### Alexa Skill Setup" section, there is the following line: "6. [optional] go back to the skill Information tab and copy the appId. Paste the appId into the index.js file for the variable APP_ID, then update the lambda source zip file with this change and upload to lambda again, this step makes sure the lambda function only serves request from authorized source." What would be the equivalent for Java skills? Apologies if this has been asked already. I have not seen it. Thank you
alexa skills kitdebugging
10 |5000

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

jjaquinta avatar image
jjaquinta answered
Yup. You need to set the system property com.amazon.speech.speechlet.servlet.supportedApplicationIds This is obscurely documented here: https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/handling-requests-sent-by-alexa
10 |5000

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

Rand M avatar image
Rand M answered
Thanks again, Jo, that worked like a champ: - My Java Lambda class extends your jo.echo.lambda.utils.SpeechletLambda - I added System.setProperty("com.amazon.speech.speechlet.servlet.supportedApplicationIds", " ") to the static initializer blocked and it worked as advertised. To verify this, I changed my appId and it failed - the logs then showed that the request "contained an unsupported application ID..." I appreciate it and want to put another plug in for your book - every echo dev should read it...
10 |5000

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